Unfortunately you didn't tell us what happens if you run the script. I guess your script keeps the bad tokens and adds the good tokens.
If you want to remove tokens, i.e. rewrite a line with good tokens as far as I understand your script, you should use write -l %entry ... in the fixile alias instead of write -al %entry .... From mIRC help file: The -a switch indicates that mIRC should append the line of text you specified to the existing text of the specified line.