I am not sure I would be much help with this type of project. I have never done anything like that before, manually or by code, because I never wanted or needed to. Some of what is being asked for does not even sound possible to me, but I could be wrong.
A part file can not store assembly level constraint related information that would simply 'reconnect' the moment it is dropped back onto some other similar assembly, as far as I know. The closest thing that comes to mind is 'iMates', but I never really got into those that much, due to the way we do things were I work. The next thing that comes to mind is the 'common origin' technique, where each components location & orientation, in reference to its parent assembly's origin work features, is recorded back down into the part, one way or another. Then when the part is placed into another assembly, it is positioned & oriented within its parent assembly using that 'common origin' data that was stored in the part (not constraint data). Sort of like when starting from a multi-body part file, then selecting the bodies within that part and using either 'MakePart' or 'MakeComopnents' commands to create a new part file(s) for each body, which only includes that one body, then create a new assembly, then put all of them into it, constrained origin to origin. They will all still be in the same locations & orientations from their own origin, as when in the original part, so we can constrain the origin's of each component to the assembly's origin to put them all back together the same way they were in the original part. No faces, edges, or vertices involved in any of the assembly constraints, just origin work feature to origin work feature. I never use that process myself, but that is one scenario that comes to mind to preserve location and orientation for assembly level purposes.
Plus, I pretty much never create/manage 'derive' related stuff by code...just manually, and not for the purposes being discussed here. So, I'm sure there must be others here who would have more insights or experience with the steps involved in this type of overall process. Maybe saving the assembly, and its components, as templates would help. Then, when you need other variations of the main assembly, or any of its components, just generate them using the 'New' command, then modify them as needed, then save them to files. With the same source documents (ancestry) each time, that should help preserve constraints when replacing one with another, and avoid the need for all the derived copies, and attempts at recording assembly level constraint related information down at the part level, which is usually not a good idea.
Plus, I stopped using VBA macros years ago, shortly after hearing that it is no longer being maintained/updated by its developers (Microsoft), making it a security risk for my company. I do all of my Inventor automations through iLogic rules now.
If someone else here could confirm that what is being asked for is actually possible, and could explain each step involved in as much detail as possible about how it could be done manually, then I may be able to 'help' with (not completely develop) the code required for accomplishing similar results.
Wesley Crihfield

(Not an Autodesk Employee)