Copy this code, then in mirc click alt+r to open your remotes. It may be wise to then goto FILE, then NEW and create a new file just for this snippet. Save it. Now, if your an OP in the channel that someone bans you, it will auto unban your $banmask, $banmask covers $bnick I believe. You can Enable/Disable this snippet by right clicking in a channel, and you can also Enable/Disable a punish nick for banning you. I included a timer to help prevent mode change flood in the ban channel.
menu channel {
Ban Protection ( $+ $replace($group(#banpro).status,off,Disabled,on,Enabled) $+ )
.$iif($group(#banpro).status == on,Turn BanProtect (OFF),Turn BanProtect (ON)):{
$iif($group(#banpro).status == on, .disable, .enable) #banpro
.echo -a Ban Protection $iif($group(#banpro).status == on,Enabled,Disabled)
}
.$iif($group(#banpun).status == on,Turn BanPunish (OFF),Turn BanPunish (ON)):{
$iif($group(#banpun).status == on, .disable, .enable) #banpun
.echo -a Ban Punish $iif($group(#banpun).status == on,Enabled,Disabled)
}
}
#banpro on
on *:ban:#: $iif($banmask iswm $address($me,5),.timerbanpro 1 $rand(1,4) $iif($nick != $me,$iif($me isop $chan,$iif($group(#banpun).status == on,mode $chan -bo+b $banmask $nick $nick,mode $chan -b $banmask))))
#banpro end
#banpun off
#banpun end