I think what needs to happen is for Tarvek to somehow persuade Gil that he needs to wear the helmet and grasp the electrodes - and let's face it, Tarvek can do that without breaking a sweat. And then Agatha walks into the room, the Baron asserts control and Agatha hits the switch at the same instant.

Process better be either instantaneous or debilitating while it occurs, because the Baron in control of Gil's body could likely do a great deal of harm to Agatha in a very short period of time using only materials available in a biolab.