How can I modify a stored scriptable object (asset file) with a preprocessor script?

I have user editable configuration data as a scriptable object and I’d like to reset some of its fields to default values before creating an executable build.
I tried to just delete the asset and then recreate it, but this causes issues where game objects that reference the original asset lose their references, even though the name stayed the same.

Is there a way I can load an asset, modify a value in it and then save it back to disk somehow?

Why not just duplicate the scriptable object with the default values you want. I don’t think there is a possible way to use preprocessors that will protect references. Just have a piece of code read the default scriptable object when you want to default. That way you makes changes to both the user configuration data and default configuration data without issue.

Or maybe you can save the data locally to your local disk, but you would have to store the references as a GUID and convert that GUID to a referenced object.