Yeah I used Paint and I should have drawn it better.
The reason why I placed it there is to avoid touching the battery connector with the battery held in the wrong way. I think I will move the diode to another place as actually it is more plausible to plug the external power with a wallwart and the connector in center-negative configuration. Is it ok to use a 1N5822 schottky barrier diode for this (Vf is around 0.5V)?
Before the LM317 I placed a 10uF capacitor for smoothing out voltage fluctuations: is this good also for "debouncing" the switch between the two power sources?
Is there a way to make sure that power is drawn from the battery until the external connector is properly plugged in? There is a small range while plugging in external power where the PCB is not powered at all.