hello
<the help says: The sockwrite event is triggered when mIRC has finished sending all of the info which you previously queued for sending.

It means it sent some data, not all.

You must make sure that $sock($sockname).sq <= 16k (top!!!!)
I recommend 8k value so when you are testing and it fails, case you are sending 4 or 8k bytes packets, it means that you always have less or equal than 16k.
You must make this test before you try to send something to the socket, if the test fails you only have to return the event. Next time the event is called you will have more space in the socket buffer to send.

Hope this helps