How did the gyro gunsights of WW2 get the range and lead of a target?
You are seriously over estimating the technical capabilities of the time. 

The gun-sight is not much more than an intricate slide-rule. You had to feed it information about the target size/aircraft type and it used the gyro information from your own aircrafts turn rates to project a reticule circle on the glass. 



The position of the projection is offset from the guns aiming point according to the gyro factors, the set range, and the fall rate of the ammo. When the reticule circle lines up with the wingtips of the target you are at the right distance and angle to the target and you push the trigger.

It assumes you are following the same flight pattern as the aircraft in front of you. That is.. chasing it in a dog fight. That makes it fairly limited in use and effectiveness and would be no replacement for a seasoned pilot.

Additional Reference Links:

Aviators Database

Axis History Forum

Video: Gyro Gunsight Mk IID 

CORRECTION:

Upon watching the video it is apparent that the implication that the aircraft must be following the same flight pattern as the target is misleading. In reality the target reticule, and in effect the pilot's aircraft, needs to be turning at a rate to track the target's flight pattern. Further, the range can be adjusted while continuing to track the target. That all sounds a bit like rubbing your head while patting your tummy and I am sure took quite a bit of practice and an accommodating target that maintained a constant heading or turn rate in front of you.