You may be able to
adapt the code in this file to work for what you want to do. It's something I made for another thread earlier that allows you to add names to an array and it gives you an error if the name is already in the array.
You could do something similiar to the loop that checks the entire array to see if the name is already in it. If the word is found, then ........ else (not a valid word) ........
I can't look at your file now, but will later at home if you can't get it on your own. I always find that getting it on your own is much more satisfying. Good luck.