That works perfectly for the addition of shared parameters but requires opening the family. Perhaps working on python you could do what I need but I’m not an expert on codes.
To modify a file, one must first open the file to read the data contained therein - doesn’t matter what the file type is, EVERY file type works this way.
To open a Revit family, one must use Revit or you get a bunch of compressed data streams which don’t have any real meaning.
Ergo to modify a Revit family one must open the file in Revit. You can see more or less of this process depending on how you open the files.
Background open may work well with some modifications of the content @MartinSpence previously provided.