Your duplicates and transforms are based on object selections, first time 1 is selected and duplicated, second time 2 are selected and duplicated and so on.
And your duplicates are added to bpy.data.objects so your loop maybe loop for ever.
I think I got this last night - the script selects the first object, duplicates it, finds the second, duplicates it but with the first still active. So for three objects there’ll be three copies for the first, two for the second etc.
Even though bpy.ops.object.duplicate() duplicates an object and deselects the original, it creates a new and selected copy.
EDIT:
solved this for myself - I took the duplicate() out of the for loop iteration so that I only got one copy of all the selected objects