You hit the nail right on the head with the 500E blowing away the E34 540's. It would also make a tidy snack out of an E34 M5 as well. As far as E34 540 vs W124 4.2 V8... Although they are essentially similar configurations they are different cars. The MB 4.2 engine(covered in detail in the 400E review of this site) is much stronger than the BMW 4.0. Where the bimmer wins some points is with a very sweet tranny. The 5 speed electronically controlled automatic in those cars drives very similarly to the new electronic 5-speeds in the MB's. Since you have an E420 I don't need to tell you what a pain in ass the combo of that 2.24 diff and tranny can be. Saying it has a stubborn mind of its own is being kind... The character is different. The BMW has the peaky engine and sweet tranny. The E420 has the torquey engine but a transmission that hinders it somewhat. It comes down to the driver's preference; what traits you like better. Braking between the two is about equal despite the bimmer having a bit more rubber on the road(stock). Handling: the BMW is the better performance handler out of the box but it isn't anything that couldn't be met or exceeded with a good set of aftermarket rubber on the Benz. Without getting into a "modified this vs modified that" debate let's just say both handle well and both have room for improvement. The BMW did not have the solid/quality tactile feel of the MB when it came to all the interior bits, switches, levers, etc. Test drive both, the individual you are will determine which is right for you. Note* The 4.0 V8 in the BMW was plagued by very premature compression loss problems.(the block dissolves!) BMW has warranted certain examples under certain circumstances but it is a definite case of caveat-emptor! Because of this resale will be very poor. If your really interested, I will go into specifics of the BMW problem... Aftermarket on the BMW is a bit different. Short of what I have already covered in previous posts the E420 can't be tuned much further without 4-5 figure AMG or Renntech stuff. The 540 can be fit with a supercharger to get it to 500E performance ballpark for about $8000. Since the engine longevity was already a problem area on 540's any supercharged example may not live long. Bottom line...test drive, test drive, test drive. Even among the same model, individual cars will drive differently. Drive a few of each and pick your fave.
Best of Luck...Lee
PS I assume you would examine each potential car closely to make sure it had maintenance records and had not been in any serious wrecks. An independent professional inspection prior to purchase can be the best investment you make.