$bnick is only filled if is in the banmask itself. Ex:
mode #mirc +b loser!*@*somehost.com -> $bnick is "loser" even if there is no such nickname on the channel.
mode #mirc +b Jerk!*@not.my.real.host -> $bnick is "Jerk" (me) even though the ban does not really match me.
mode #mirc +b *!*@my.real.host -> $bnick is $null even though the ban does match me.

$bnick is really sort of worthless. You need to loop through $ialchan() to really find out who matches the ban or not. This means you're ial list must be updated.
Code:
on !@*:ban:#:{
  var %i = 1
  while ($ialchan($banmask,$chan,%i).nick) {
    if ($ifmatch isop $chan) {
      mode $chan -ob $nick $banmask
      halt
    }
    inc %i
  }
}
To the original poster:
You cannot really block kicks because by the time mIRC knows about a kick it already has happened. The best you can do is punish the kicker and invite the kicked person back.
Code:
on !@*:kick:#: {
  if ($knick isop $chan) { 
    mode $chan -o $nick
    if (i isin $gettok($chan($chan).mode,1,32)) { .invite $knick $chan }
    if ($chan($chan).key != $null) { .notice $knick Please rejoin. Type: /join $chan $ifmatch }
  }
}

Another note. You kind of need a deop protection script as well. Otherwise one op could deop another op, then kick or ban and your script wouldn't protect them at all. Deop protection scripts can be kind of dangerous. You WANT your channel ops to be able to deop a person if they got accidently opped.