Seriously ?
- The topic ended 4 years ago !!!
- You import 'FreeCAD' in your script but don't use it. This is useless
- Your script doesn't work if there is nothing to pause it during selection change
- If your concern is about multiple documents, you should probably look at the global placements rather than the local ones