Power source select for Raspberry Pi
It seems that what you are attempting is quite similar to what is implemented in the Arduino. See e.g. Arduino Uno's schematics. It requires a few external component (a MOSFET to serve as a switch, a diode, etc). to be implemented. I'm not familiar enough with the Raspberry Pi, so I dont know if this scheme could be implemented without modifying the board.