Hello,
Could you check if a simple failover configuration would not be enough?
Basically, configure your device as a wireless client. For instructions refer here.
Next, login to router's WebUI, navigate to Network -> Failover. Drag wireless client interface above mobile one to provide it with a higher metric value.
Additionally, edit settings for each WAN interface in the same Failover page and add the following:
The device should connect to WiFi, when it is available as it is preferred WAN, while mobile data would be used, when WiFI is out of range.
Best regards,