Is there a way to make a "macro" (Editor plugin, whatever) to run a script whenever the user saves the current scene? The only way I can think to do it is to make an Editor interface that provides a button which runs the script and then saves the scene, but that's not ideal.
I never used it, but i think a SaveAssetsProcessor would do what you need. Scenes are also just assets so they should go through this as well.
The documentation on this is very thin, but i guess you just create a derived processor and you will be fine ;)
Here's an example how to implement a SaveAssetsProcessor