Thanks for your help Madeline. This is about as far as I got:
string isTyping = "FALSE";string wasTyping = "FALSE";string owner;default{state_entry() { llSetTimerEvent(1); owner = llGetOwner(); }timer() { isTyping = (llGetAgentInfo(owner) & AGENT_TYPING); if isTyping = "TRUE" && wasTyping = "FALSE" { llPlaySound("my_sound", 1.0); wasTyping = "isTyping" } }}
It says there is a syntax error at 14, 11, and I'm sure there are other little mistakes here and there too, but I tried.
Right now the script doesn't do anything. Mind helping some more?