Install a non shorting multi position rotary switch between a isolated section of track, 4-6” longer than your longest engine, and the various desired outputs from command stations and the PR3 output terminals.
The following schematic allows a single section of track to be fed by the rail output of a command station, the programming track output of a command station, and the programming output of a PR3.