OK, so the stripped code I gave as an example is now working, I don't know what I was doing wrong.
But I'm still having issues with arguments passed to the script. It seems that whatever I specify in the arguments box get combined and sent as a single argument, ie if I set arguments to:
%g0 %g1 %ss
.. then my script will receive (eg) "High Low -56 dBm" as $1 - what I want is "High" as $1, "Low" as $2, and "-56 dBm" as $3 (note the space in the latter argument).
Am I doing something wrong?