Writing raw text and then loading it as a script is dangerous, instead you should just keep a list of commands and responses.

Code:
on $*:text:/^!addcommand !?(\S+)/iS:#:{
  writeini commands.ini commands $regml(1) $$3-
}

on $*:text:^!(\S+):#:{
  if ($readini(commands.ini,n,commands,$regml(1))) msg # $v1
}