Hi,
It is not recommended to switch ON and OFF the vaccum pump just for removing the workpiece. This would damage the pump parts over time and also most probably the machine may stop with emergency alarm due to the vaccum stop. AFAIK there is no way to do this via G or M code.
Solution:
Firstly you need to release the panel using valves and not directly switching the pump ON and OFF, secondly in order to achieve the what you say is connect a sensor into the machine or the robot that actuates when the arm comes near to the machine for lifting up the panel. Use this sensor to operate the valve, like the valve shuts when the arm is near the workpiece and open when you keep another workpiece on the worktable.