Once you have your script working, you can test it remotely with your personal SSH key. Just load your key in the agent and use your script as an argument to ssh.
Create a new key for running your script. This should not be in your normal .ssh/identity file since the key will only be used for automated execution of the script. You will probably want to create the key without a passphrase.
Add the public key to the authorized_keys on the remote host.
Test execution with the key.
Add whatever restrictions you can to the key in the authorized_keys file. This should probably include from= command= no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty