If the first part of the routine is create record, cause a commit, then enter data into a validated field this is the phenomenon you will get because the record is already created and revert will not roll back the creation event.
First thing learn all the events that can cause a commit.
Click into empty space on a layout, navigate to a new record, commit script step. etc...
Then you could script the process of record creation to include entering data into global fields, validate the data, then create the new record with the data from the globals
You might consider using a relationship rather than field validation to check uniqueness. Also keep in mind that two different individuals can have identical first last names so you may need to use a method that compares more than just names.
You probably want to stop even the previous step happening (i.e. record creation) - what i would do use some global fields to hold data entered, check for duplicates (e.g. with a relationship) and if none then script a record / ID number creation, rather than rely on record validation.
Hope that helps,
Thank you everyone for the responses. They all make sense except that I have no idea on how to write script. Are there some sample scripts that I might be able to adapt?
Thank you. You're absolutely right. What other method would you recommend? I don't gather much data on these contacts such as date of birth, social security number or other unique identifier.
For distinguishing between two individuals or even two companies with the same name will require something more. What that "something" is is totally up to what other data you choose to require.