You can have a listening socket that mIRC connects to as if it were a normal server. You forward these messages to the socket connection you have to the external server. This means you don't have to send RAW yourself, mIRC does it like any other connection. But then it means the bot is not running in the background.
If you want to handle the sockets yourself of course there is no way to avoid dealing with the protocol.