Most networks that I've come across that use something like this send the message as a notice. Thus having a script that uses the ON NOTICE event to track if the numeric has been received or not, and the ON JOIN event to check if the numeric has been noted by the ON NOTICE event would be my suggestion.
I believe you would still be able to join the channels using your Favorites, but if you have commands in the Perform section, then this should replace them as the Perform section commands are issued before the scripts are checked.