You're right it's 1 not 4. But an int (number data type) should be 4 bytes long. It could be because of that little/big endian stuff, so maybe try reversing the different bytes of the int's.
0 0 0 1 -> 1 0 0 0
1 2 3 4 -> 4 3 2 1

What you should do, is download a packet sniffer like ethereal and use that to see what actually gets sent by a standalone rcon client, by your client and by the game server. This way you can determine what the difference is, and if it's really the sending or the receiving that's not working in mIRC.
In this case, enable the packet sniffer, un the rcon program and stop the sniffer, then check the log for the connection to the server and see what data is sent, and what it should actually be.

I also find the on sockread event handler very strange, I think there's some $bvar problems. Try just writing everything to a file and open that with a hex editor. Make sure to remove or rename the file before each test smile

sockread &data
bwrite rcon.txt -1 -1 &data