That $nick should be $$1. $chan can be # for short. It\'s kinda late.
Yours would be nice if their versions didn\'t support the \"-k\" switch I\'d also suggest using:
kickban { var %kbnick = $$1, %kbreason = $2- ban %kbnick 3 | kick # %kbnick %kbreason }
That way you don\'t need to unset the vars.