It is not part of the IRC protocol to send an ICMP packet for any reason. You should be able to block all ICMP packets and have no connectivity issues to an IRC server as a result. If my memory serves me correctly, this is the process that would occurr if a server wants to let the client know that it's closing the socket: it'll send a FIN (the FIN flag turned on in the TCP header) packet to the client. The client can then respond with an ACK packet to acknowledge the FIN, and can also send its own FIN/ACK packet packet in which the server understands the client to be closing the socket and responds with an ACK packet to acknowledge the fact. In those circumstances, both sides have come to the understanding that both sides/sockets have closed. This is all part of TCP doing its job to ensure transmission reliability. If the client never receives the FIN packet, it doesn't know the server doesn't wants to close the connection, but this doesn't have anything to do with ICMP.

Besides the fact that TCP does it's part in closing the connection, the proper thing for a client to do when wanting to quit is to send a QUIT message on the socket before sending a FIN packet. Likewise, the server should send an ERROR (Closing Link) message before sending its FIN packet.

That was probably more than is necessary for the point of proving that mIRC is highly unlikely to be at fault, but the point is that packet loss can cause the client to never see that the server closed down the socket that the client's socket had connected to.

It would be trivial to create a script to check connectivity... there are probably many ping scripts that alread do that. You can have a timer send a PRIVMSG to yourself every so often containing $ticks, and if by the time the timer reitterates you haven't gotten your PM, a message could be displayed as a warning to connectivity problems. An added bonus would be to actually subtract the ticks in the PM from current $ticks, divide by 1000 (this result is a round-trip in seconds), then display it somewhere such as the title-bar or a lag-bar.