Pre-save & post-save for tox saving

please is it possible to trigger events before and after saving some specific component?
I would like to unlock Script operators (especially TOPs) before saving the component and lock them after the save is complete.

This is due to the way how Script operators have to be locked in order to be modified outside of their cook context (explained here). Locking script operators seems simple, but since I would like to keep my tox sizes small, I would like to unlock them before save.
However I can’t seem to find a way how to do it. Thanks.

The execute DAT has callbacks for project saving that might be useful.

As for specific Tox saving stuff, I’d probably go grab a fresh copy of Matthew Ragan’s base_save and modify it to suit my needs.

Here’s a link to the repo, just in case it’s useful:

Thanks, but project saving callbacks in execute DAT won’t trigger on tox save. And when it comes to custom tox saving it is certainly an option - but I would like to avoid that and stick with default workflows if possible.