var %x = $nick(#,0),%y
You var %y and never use it.
Btw, you can use /ban -k to combine the kick and ban lines together.