When you use /sockwrite you are in effect queuing data to be sent on that socket.

Once the queued data has been sent, mIRC will trigger the on sockwrite event to indicate that you can now send more data.

Remember to check for $sockerr in the first line of the event though to check if an error has occurred.