However, without switching (just idling), approximately every minute I observed the following ERROR messages in the log:
I don’t understand how you can be getting an error if you are just idling. My script only starts up and runs when you run a command. If you are using some of my rules then there should be a cron job that runs every now and then to get the state or update the state.
It looks like you are running a -Set command but the arguments is not properly formatted. So have a look at any cron jobs you have running and see what commands they are running
Also try and enable warnings and errors in any rules so we can see what command is being sent., change the debug lines in the rules to true.