You might want to change your code to:
on *:text:!kon *:#: {
if ($nick isop $chan && $$2 ison $chan) {
set %kick $2
msg $chan $2 next time you get talk you will be kicked
}
}
Hence the space between !kon and the *, and the $$2. This makes sure $2, the nickname, is set and that it is in your channel.
You should also combine those three text events.