A method and system is described for ensuring a state of an active implantable medical device based on the presence and persistence of a magnetic field. The output of a magnetic field sensor is monitored. The active implantable medical device is maintained in a first state, for so long as the presence of a magnetic field is detected by the magnetic field sensor, until a first interval is surpassed. If the first interval is surpassed, then a determination is made as to whether a second interval has been surpassed. If it is determined that the second interval has not been surpassed, then the active implantable medical device is transitioned into a second state. If it is determined that the second interval has been surpassed, then it is ensured that the active implantable medical device is in a predetermined one of the first and second states.