you are going to run into troubles at some point, when your script tries to make a file that contains illegal characters. Some characters which can be contained in a nickname, like | for example, cant be used in a filename.
You're probably better of using a hash table.
Things to check out: /hadd, $hget, /hsave, /hload etc. /help hash tables