I don't think you can do it and have Uniqueness and Repeatability.
Uniqueness can be achived easily by adding a sequencial number to the end of you current algorythm. This number can be either N=N+1 for all individuals or just when a duplicate is created.
Repeatability is harder since:
1) People can be reported with different names census to census but be the same person.
2) Marital status can change, or DOB can be off by a year, day or month,
3) The first John Doe found in the 1900 censu could be the second John Doe in the 1910 census.
Personally I do not think that you can automate this process since if you could Ancestry.Com probably would have done it already and charged you to see what they did. Remember, families do not alway report together in the same place. Men at sea or working as labourers in fields 100's or 1000's of miles away will not be matched.