What's the quit reason people see when it happens to you?
This hasn't happened recently, but I remember cases where my connection has died (mIRC hasn't timed out yet), I've tried to sent a message and mIRC has disconnected me instantly. Some kind of a TTL check thing.
No idea how messages sent by scripts were handled, though.