on *:text:#:{
should be
on *:text:*:#:{
and for the ban you could do
if ($1 == ban) { ban $chan $2
you also have a bracket missmatch