The implementation the way you have it written as “every ##” minutes does not have a starting reference besides when the piston was saved. In other words if you saved the piston at 3:37PM, it will start that every 30 minute counter so it would run that piston at 4:07PM, 4:37PM, 5:07PM, etc. If you elected to have the cycle be every 1 hour instead of 30 minutes you can set at how many minutes past the hour so its a accurate trigger. Should you want it at the 30 minutes interval you would just have to make sure you save the piston 30 minutes ahead of when you would want it to start. So if you wanted it to run right at the top of the hour, every time you save that piston, save it at 30 minutes past whatever hour.
I personally like conditions laid out in a flowing manner so instead of using the hour conditions on the timer I added it as a condition to the action. The second condition being whether the door is actually open instead of telling the system to close it every instance.
So see below how I would start with it.
Since this piston does not have the presence sensor controlling the switch in any manner there is no need to include it as a restriction. This would run 10:30PM - 6:30AM regardless of what your presence status is.
So my follow up question is what you do want the presence sensor to do in relation to this switch?