Something similar to LUA script in PX4

I am working on a project where i have total 6 motors, 4 are main (tilt) and 2 motors (aux) in wing (which is only used to provide assistance during hover and operates till transition ends).

The two motors acts like a booster motors. There are comparatively less powerful than the four main motors.

My current frame is generic quad VTOL. Hardware Pixhawk 6C.

In addition to the two booster motors in wing, there is a mechanism which opens and closes based on the mode i.e., MC or fixed wing and that is operated by separated servos.

At the moment, i am using RC switch to turn on the booster motors and they run at a specific constant speed, irrespective to the throttle input. and the closing mechanism servos also opens and closes with RC switch.

I want to implement a code, where closing mechanism opens and closed based on the current flight mode. (completely open while MC, completely close while FW, and at a specific angle while transition for thrust vectoring).

Is there any possibility to add additional code to control these motors and servos?

Is it possible to send more than 16 signals from the PX4 via CAN? I am using pixhwak 6C