Hi Mike,
There's nothing officially available that will let you automate this ... yet ... But I think it would be a good feature request for the upcoming SDK/API.
The only thing I can think of at the moment would be to automate this through the UI, for example, send Ctrl+M, E to activate on an open VS session, then Ctrl+M, D to disable.