Unfortunately, no.
Quote:
The on ERROR event triggers when an IRC Server sends an ERROR message.

The "Unable to connect" error message is displayed by mIRC, not received from the IRC server.