I do not think there is a way of calculating the maximum length of a text message because you have to take into account the length of your nickname and address, as well as the target nickname and address or channel name. These all form part of the server message when a PRIVSMG is sent - the maximum length will depend on all of these combined. So mIRC uses a conservative value for the maximum length, although I expect there are situations where even that may not be conservative enough.

As for CTCP messages, I will make mIRC split CTCP ACTION messages by adding/removing the CTCP ACTION prefix and control codes across multiple lines. I am not sure it would make sense to split other types of CTCP messages though, since they need to be sent as one line of text in order to work anyway. This change should be in the next version.