I think the BEST solution is to find and fix the air leak, or just put a sign up on the door you exit the room from reminding you to kill the power.
You're going to create a bigger problem trying to solve a simple problem, automation is a fine concept. I will assume this is a 220 machine and would suggest a timer, the same type used for pool pumps of course 220 rated.
My compressor and not bragging btw stays on 24 x 7,365, unless I am using it does not run period, it and supply piping are a 20 + year installation to be clear.
To continue there are some screwy statements above please read:
Air compressor unloader valve.
The output of the piston compressor is connected through a pipe to the air tank. When the compressor stops, the pressure in this pipe is blown off to 0 bar (atmosphere).
This is the ssssssshhh sound you will here when the ccompressor stops for whatever reason. At the same time, a check-valve makes sure only this small pipe is empty and allows the air receiver tank to remain pressurized
Why? When the compressor starts up again, and this pipe would still be under pressure, the electro motor will not be strong enough to turn the compressor.
In other words the unloader function has nothing to do with the power, strictly a mechanical function .