This isn’t that hard to do. You use a virtual switch, so that the “light” that gets turned on when the door opens is the virtual one. That in turn fires an app that looks to see if the real light is already on, and remembers that in its state. Then, when the light wants to shut off in x minutes, again it’s the virtual switch that “turns off”, and the app looks at its saved state to decide whether or not to turn off the real light. The only way the real light gets turned off is manually (or some other logic that might apply, like a mode change or Hello Home phrase).
I just wrote an app to test this for my closet light, which ordinarily turns on with motion, and off in a couple of minutes after no motion. Now, if I have turned it on manually, it stays on until I turn it off manually. However, if it’s off, motion turns it on and it turns off after a couple of minutes.
No need for any additions to the core software of ST. Just a virtual switch and a simple app does it.