Set Servo Channel dependend on Flight Mode

Hey,
does anyone know a way to set an output channel to some defined value according to the present flight mode?
I´m building a VTOL quadplane using a CUAV v5+ as FC and need to set a servo to different positions when the VTOL is in a quad or plane mode, preferably even with an delay.

Any ideas?

Thanks for your help

This would be easy to do with a script. https://ardupilot.org/dev/docs/common-lua-scripts.html#common-lua-scripts