If the system that runs that machine is open enough, it's not hard. Use M8/M9 to turn a relay on and off. But turning off a vacuum pump isn't always a good thing to do - depending on what you're using it for. If you've evacuated a bell jar, you can end up sucking all the oil out of the pump and into the jar if you turn it off without releasing the vacuum. But if you're just using rough vacuum to hold parts down, it shouldn't be a problem.