I'll modify the ancient script, but i would like understand.
I don't think it's a problem of names.
I try the script with an empty database.
I put one movie, import informations of this movie and reimport informations. Now In the database i have 2 actors different with the same name and the first have no link of the movie in the filmographie Field.
And it's not a problem of name as O' ... or T. in tis cases with PVD, an other entry is create but the links of existing movie stay in the filmographie, just the new movie appears in the new entry actor. I don't know if i'm clear.