Nice suggestion!
Just to note, on the Mac there's already a /usr/bin/say, which invokes the text-to-speech. So if you don't create your function, SSHing to the friend's Mac and typing 'say whatever you want' will have an interesting but probably not desired effect :) I'll admit to having used this on a friend's machine once or twice for amusement.
(And invoking 'say' invokes the TTS even if you SSH in as a user other than the one logged in to the main GUI. I'm pretty sure this wasn't always the case; not sure when it changed.)