How are you using the trigger because in your script your checking if bot == $me but that would check if you were called bot and in a on text event it doesnt trigger you has the $me

I would change both occurange to like nickname == $nick and leave it as is

Code:
on *:TEXT:*:#test:{
  if (!add isin $1) {
    var %x = $remove($1,$left($1,-4))
    if ($read($+(%x,.txt),nw,$2-)) {
      msg #test This already exists!
    }
    else {
      write $+(%x,.txt) $2-
      msg #test This has been successfully added.
    }
  }
  elseif (!del isin $1) {
    var %x = $remove($1,$left($1,-4))
    if (!$read($+(%x,.txt),nw,$2-)) {
      msg #test This doesn't exist!
    }
    else {
      write -dl $readn $+(%x,.txt)
      msg #test Has been successfully deleted.
    }
  } 
}


try that too see smile