if ( [ [ $+(%,spammer.,$fulladdress) ] ] ) {
your permban here
kick him
maybe also unset $+(%,spammer.,$fulladdress)
}
else {
set $+(%,spammer.,$fulladdress) 1
tempban here
kick him
}

To start your chatting in a forgiving mood, you can use on *:START:unset %spammer.*
You can change $fulladdress for $nick or $address depending on what you want exactly.

Maybe $regex can be usefull to check for 'good' or 'bad' appearances of #, also watch out for # between spaces being replaced by the #channelname by mIRC, use $chr(35) in that case.

ps: I noticed that /ban has a -uN switch, that would save you from messing with timers...