The first schematic does nothing as the transistor is always switched off.
The second is some complicated affair doing something that can probably be acheived by a diode, from your description of powering the Atmega from USB when some other supply is not working a simple diode,anode to usb+ & cathode to Atmega 5V should work, of course I may have misunderstood your explanation ?