I'm curious if you meant for the letter "a" to append to the current line of the text file. If so, you have it at the wrong spot, it should be right after the word "write." What you want to do is pretty simple if you just want to exclude one user. Ideally, a script like this should have some sort of protection so the same user can't add themselves twice, unless that is how you intend the script to be used. Assuming that the script you provided is how you intended it, you can do the following to exclude one user:
ON *:TEXT:!add*:#: {
IF ($nick != banneduser) write list.txt a $2-
ELSE MSG $chan Sorry, $nick $+ , you are not permitted to use this command.
}
I helped someone with a similar request before,
the following may help.