If you don't put the { on the same line as the /if, you will get * /if: insufficient parameters.
Most of the tests can be done easier too...

on @2:text:!kb *:#:if ($2 ison $chan) ban -k $chan $2 2 $iif($3-,$v1,Bye)


In channel, type !kb nick reason