In your script you should be checking the return code of the symcli command that performs the SWAP. The back of the  EMC Solutions Enabler Symmetrix CLI Command Reference document has the return code tables.
I have scripted SRDF replication from end-to-end. Inseted checks-n-balances verification steps before proceeding to next step. Don't know how to verify if "srdf" personality swap is successful.  I am sure someone has figured out and implemented the procedure.  Any pointers would be a big help. Thanks!
SRDF swap verification?