You should use the [ code ] and [ /code ] , and I added one } at the end for you wink

Code:
on 1:TEXT:*:#some-channel:{
  tokenize 32 $strip($1-)
  if ($1 == cmd1) {
    write file1.txt $gettok($1-,7,32)
  }
  elseif ($1 == cmd2) {
    write file2.txt $gettok($1-,7,32)
  }
  elseif ($1 == cmd3) {
    write file3.txt etc..
  }
}
...

etc...