To track the full mask with the banned nickname's IP address, you can use this line:
Code
.echo 5 $chan BAN by: $nick >>> $banmask >>> $bnick $+($chr(40),$address($bnick,5),$chr(41))

Regarding the impossibility of performing a kick on a channel, are you sure that you have a sufficient level of rights for this on channel?
It may also be related to the established restrictions through the channel modes. For example, in InspIRCD when "+Q" channel mode is enabled, it is forbidden to kick, except for a certain group of users.
Please make sure that there are no restrictions for you to perform kicks on these channels.

This is probably a better solution for you with the /WHO check command. I tested this piece of code on my server and it works great:
Code
on *:BAN:#:{
  if ($gettok($banmask,2,64) == $chr(42)) {
    .echo 5 $chan BAN by: $nick >>> $banmask >>> $bnick $+($chr(40),$address($bnick,5),$chr(41))
    .kick $chan $bnick Banned by 10★彡09 $nick 10彡★, Kicked by 10★彡09 $me 10彡★
  }
  else {
    .hadd -m cban-nick $chan $nick
    .hadd -m cban-chan $chan $chan
    .hadd -m cban-ip $chan $gettok($banmask,2,64)
    .who $chan
  }
}
raw 352:*:{
  if ($hget(cban-chan,$2)) {
    if ($4 == $hget(cban-ip,$2) && $6 ison $2) {
      .echo 5 $2 BAN by: $hget(cban-nick,$2) >>> $6 $+($chr(40),$3,$chr(64),$hget(cban-ip,$2),$chr(41))
      .kick $2 $6 Banned by 10★彡09 $hget(cban-nick,$2) 10彡★, Kicked by 10★彡09 $me 10彡★
    }
    halt
  }
}
raw 315:*: if ($hget(cban-chan,$2)) { .hdel -sw cban-nick $2 | .hdel -sw cban-chan $2 | .hdel -sw cban-ip $2 | halt }

    [Linked Image from i.ibb.co]



🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples