May need some fine tuning, now it sends an 'is writing' every 500 ms and it assumes that someone stopped writing after 3 seconds of inactivity.
It's like Windows Live Messenger, someone stops typing and we'll get "Go on Tim, what were you going to say?"...