You need to use the ^ event prefix to indicate to mIRC the event must be triggered before mIRC's own behavior is applied for that event, without it, the event is triggered after mIRC already sent /join, basically.
Edit: even with that prefix, it does not prevent the joining of the channel if you have mIRC set to autojoin channel when invited, maybe that would be a bug.