the event triggers twice because you didn't read all the data from the receive buffer the first time: $sock().rq would probably reveal that there is more information to read. i say 'probably' because if you try this test many times, you're bound to get 'correct' results at least some of the time.

as drum said, it's just the way UDP works :P you can't guarantee that the data in the receive buffer came from multiple sources at the mIRC level, and i don't think it can be done seamlessly at the C level either (if we assume that the application polls the system for new incoming data - the two datagrams you send may be received by the system in between polls).

you could have the clients encode all details that could potentially be lost as the first few bytes of every message.