Python Releasing Control to Transmitter when Transmitter flip is switched

This is not a question about sending 0s to PWMs.

When running a Python script in Mission Planner, using Script.SendRC(…) will cause the RC controller to be locked up.

If there are no problems, having some sort of function in Python to SendRC to all of the PWMs would release control back to the RC Transmitter. Now my question is, are there any ways of detecting a switch flip on the RC Transmitter’s modes to trigger a response in the Python script to play some function which releases the control instead?

I’m looking for something like a state change in the switch of the RC Transmitter.

Eg.
saved_rc_state = GET THE STATE OF THE SWITCH ON THE RC TRANSMITTER WHICH CHANGES FLIGHT MODE DURING MANUAL FLIGHT
if CURRENT RC STATE not saved_rc_state:
some function to release control

Reason being, during times of emergency, flipping a switch to get control is faster and more convenient than using a mouse to click.

Please help!

Thank you!!!