Temporarily halting a sensor? (help)

Thanks for your efforts struggling against the problems with the forum. I will create some test code of both types and test it.