How to enable Aruco based landing in RTL mode?

Hello there!

I am currently working on Aruco based precision landing for quadcopter. The script works perfectly and the UAV lands precisely in guided mode. However, I want it to land the same way in RTL mode similar to IR beacon and IR Pixy Cam without running the script every time. Any suggests or inputs would be really help. Thanks in advance.