Seems intended to me.
You perform /sockwrite and the data is added to a queue.
You then immediately /sockclose before mIRC has chance to process the queue. The help file doesn't suggest that /sockclose is also queued, as there is no need for it to be.
mIRC is a single-threaded application and will process the rest of the sockread event before it deals with the send queue.
You should close the socket in the on SOCKWRITE event to do what you're trying to do.