A few of us talked about this internally, and we don't see a good option. Once you start the job, it's running. A nonzero return code from a script will fail the job. You could customize the plugin to get around this, btu that would require some coding.
One option would be to write a wrapper that checks whether a database is running as a standby, and if it isn't then it launches the SC job via the cli.