As Jurij said, I don't understand this moving group at the begin of the script, because only one node have access to the shared disks, then if you execute this script in one node, it will probably fail.

Just place offline the resource, copy the database file, controlfile ... and place the resource online, always in the node who has the control in this moment.

Regards

Angel