There are two ways to run heat and AC, neither are perfect for that situation.
Full climate - this is only available when the car is turned on in READY mode, which you can only do when the car is not plugged in. Full climate uses power from the main battery, so it slowly depletes whatever EV range you may have. When the EV range gets down to 0 miles it will start the gas engine to recharge the battery for a few minutes, then it shuts off again. Depending on how much demand you are putting on the heater (or AC) the engine will typically run for a couple of minutes every ten minutes or so. It's not that noisy but it depends on whether you are a light sleeper if you would be able to sleep through the engine briefly coming on every ten minutes. And of course you need to have enough gasoline in the tank, but it doesn't really use that much gas since the engine only comes for brief periods. So much better though than a regular car where the engine has to be running constantly in order to use heat or AC.
Preconditioning - this is only available when the car is not turned on. But you can be plugged in. When the car is plugged in preconditioning draws power from the charger and thus does not deplete EV miles. And with Level 2 you can also charge and precondition at the same time. But preconditioning only runs for thirty minutes at a time then you have to restart it. And it only provides partial heat and AC, as it is designed to just sort of take the edge off so that when you get in the car on a cold day the cabin with be slightly warm instead of freezing cold, and on a hot day the cabin will be slightly cool instead of baking hot. And then when you do turn on the car the climate control can more quickly get the cabin to your set temperature. The main problem if sitting for a long time is you have to keep restarting preconditioning every thirty minutes, not so easy to do if you fall asleep.