Why do you have the $ prefix for the event? you dont even use it. Also you should add an if ($active != $chan) before the echo.
Another thing people may like better is if you change it from saying someone said: blah to: someone is speaking of you on $network $+ , $chan $+ : $1-