I don't know which script would need to be edited in order to stick your command in it (I too would like to find out), but I just thought I would mention that there's also another way you could approach this: Have a cron job run every minute checking to see whether a screensaver is running. If there is, your program gets started; if there's not (and your program is running), your program is stopped; if there's not (and your program isn't running), nothing is done.
Yes, this method sucks compared to what you currently have in mind, but it's an alternative nevertheless. Like I said, I too look forward to learning which script to edit in order to do this in a more kosher way. I don't have anything serious which I'd want to execute when the screensaver comes on but making an ogg/mp3 play would be cool.
