[...]turn the thermostat off if a door sensor indicates an opne door for some length of time (say 5 minutes), and once closed turn the thermostat back on to its original setting.
For the 'door open' part you're probably going to need some code to get the delay in there. Check
this out, the second example. In the scene created per the example, you would pick whatever you want the thermostat to do in the Commands tab of the scene.
For the 'door closed' part you can probably create a scene without any code, with the appropriate sensor event and thermostat command.
I guess it can get tricky, depending on what your requirement is for 'return to original setting' / what the capabilities are of your thermostat. Switching between 'energy save mode' (if there is one) and back to normal may work.