On twine you should be able to use a variable to store what codes are entered and check if the new one is not in the list before validating it (you might need to code some javascript for that tho)
I might try to void it from the user input array upon checking, then check the array again for the item. That should catch repeat entries....right? (I'll test it obviously)