Is there any way to make it such that whenever a save is opened, a Lua function runs?
No for security reasons. Because if saves could have scripts then you could add malware to a save.
I assume he doesn't mean code in a save, just a function in a script that runs when the game loads a save.