You will need a Single Pole Double throw switch in an ON - none - ON configuration. The switch will have three contacts on it. The center one should go to the BLACK decoder wire. One side should go to the left track pickup. (So if the BLACK wire is going to the left hand track pickup, then the RED decoder wire would go to the center switch contact, and the side switch contact would go where the RED wire would normally connect to for the right track rail.) The other side of the switch would go to the panograph. The overhead wire would have to be connected to the right rail. However, when you turned the loco around on the track, it wouldn't work.
Normally, to run a loco from a panograph, both track rails would be tied together as BLACK, and the panograph would be on the RED wire. But if you did it that way, you could only run electric locos with panograph pickup.
In my opinion, rewiring the loco this way is not worth it and it will only get you in trouble.
I do not recommend it. Wire the loco as you would normally wire any DCC loco.
The replies in your other post on this same subject should not be ignored.
Elmer.
The above is my opinion, from an active and experienced Model Railroader in N scale and HO since 1961.
(Modeling Freelance, Eastern US, HO scale, in 1962, with NCE DCC for locomotive control and a stand alone LocoNet for block detection and signals.) http://waynes-trains.com/ at home, and N scale at the Club.