Yes, there is. There's some additional logic in the script I took that snippet from. I pause iTunes, play a sound file, and then resume iTunes, but only if it was playing to start with. That's why I need to control playback within the script (I need to know if iTunes was playing to start with before I tell it to start playing again).
There are some fairly nasty workarounds that I can think of, but what I really want to know is why the script can't control iTunes when called from the shell. It's very irritating!
Cheers for the reply