Not saying this is an elegant solution, but I finally got something working today that does this. (Which I needed, because I'm using linked Sharepoint Lists, and data integrity rules don't get enforced well on Sharepoint.)
WARNING: I haven't tested this yet for removing multiple duplicates...