This would be a job for dronekit, not ardupilot/copter/plane/etc. I doubt you'd have to actually touch ardupilot.
Here's how you could directly set the flight mode: DroneKit-Python API Reference
You can also set event observers so that when the flight mode is changed, secondary actions are automatically triggered. I believe what you want to do would be *relatively* simple. I am not an expert python coder, I primarily use PHP/C++ but it's not too difficult to do stuff. I've messed with some basic and creating misssions, etc. The docs and examples are really pretty decent. You can really make the solo do some incredible things via dronekit and even create custom smart shots. I wish I had more free time...
Here's how you could directly set the flight mode: DroneKit-Python API Reference
You can also set event observers so that when the flight mode is changed, secondary actions are automatically triggered. I believe what you want to do would be *relatively* simple. I am not an expert python coder, I primarily use PHP/C++ but it's not too difficult to do stuff. I've messed with some basic and creating misssions, etc. The docs and examples are really pretty decent. You can really make the solo do some incredible things via dronekit and even create custom smart shots. I wish I had more free time...