How to automatically switch RF path to external antenna
A few points which might be useful:

1) there are connectors with an RF switch in them, which are designed for exactly your situation. They pass RF to an internal antenna if there's no connector installed.

Of course they can't tell if there's a working antenna, only a connector plugged in. Also they're only available from tiny on-board connectors up to about mcx size, which is still pretty small, not rugged, not designed for many insertions, so this would only be useful for a one-off switching event, say if you had two installation options.

2) you may be able to detect the external antenna by its DC short circuit. Most antennas are DC shorted, it's good practice, and this would simplify your circuit a lot. Just a bias T, a power supply, and the RF relay. Don't forget protection diodes to prevent any spikes from ending up on the RF line. In fact, best to use a transistor and keep the voltage and current on the RF cable as small as possible.

3) detection by looking for return power means the radio will see an open circuit for a while, is this OK? If the wrong antenna is selected, the whole packet will be lost, what is the impact of this.

4) you'll need a supervisory crcuit to check regularly for the presence of an external antenna, every few minutes I suppose. You can only check this when the modem transmits, so you have a fairly tricky operating procedure. Think this through carefully.

5) your RF switch might end up being switched hot - is that a problem? Depending on the power levels that can damage a switch. It would be best for the transceiver itself to detect the antenna and make the switching decision. Not sure if this is possible for you though.