Hi,
are your RS232 and USB interface connected to different ICs? I assume so.
A possible solution would be a Single Pole Double Throw (SPDT) switch IC, as it seems your USB D- pin has not to be switched.
Connect the normally connected output pin to D-, and the normally open output pin to the MAX3221.
Use your supply voltage to change the switch psoition e.g. by a voltage devider followed by a scmitt trigger. So if your voltage is above the SPDT switching logic level, the switch position is changed.
I assume you will have to create an appropriate cable by your own, which is connected to your input pin (P? - Header 5). If so, just do not connect RS232 DL so you have not to disable the MAX3221 (except for power consumption issues). Otherwise use a dual SPDT switch.
greets