I have been digging to try to find the technical reason for placing the flap where they do on the P38.
When compressibility hits, shockwaves are formed initially on the top surface of the wing, and there is flow separation after the shock wave, which is why the wing loses lift just as if it were stalled while not in compressibility. This is known at "mach stall" of the wing, and is like this:
![](http://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Transonic_flow_patterns.svg/286px-Transonic_flow_patterns.svg.png)
There is no flow separation in front of the shock wave. So, if you want a flap to increase lift of the wing (to make up for the fact that everything behind the shock wave is producing no lift), you need to put it in the forward portion of the wing rather than the stalled-out rear of the wing.
Putting it outboard of the nacelles means it will generate less potential turbulence or other effects to airflow for the elevator.
With regard to whether or not the "dive recovery flap" increases lift or drag, it does both, because generally anything that adds lift is also going to create at least some (not zero) drag. The main purpose of the flap is to increase lift, though. It helps avoid or at least reduce "mach tuck," which is the nosing down of the aircraft as a result of the mach stall, and helps give the wing some lift instead of none. Adding drag is also helpful for obvious reasons, so even though it is a side effect, it is not a harmful one.