This script should kick ban the user matching mask already in the channel when I get a #channel spam from outside the channel. Any ideal why it dont work?

on *:text:*:?: {
if (%Relay == off) || !%Relay || ($nick isop #) { return }
var %s.chan = #manila
if ($nick !ison %s.chan && $me isop %s.chan) {
var %nick.addr = $address($nick,2)
var %cnt = $nick(%s.chan,0)
while (%cnt) {
if ($address($nick(%s.chan,%cnt),2) == %nick.addr) {
ban -k %s.chan $nick(%s.chan,%cnt) 2 14Relay Spammer Detected
}
dec %cnt
}
}
}