I now use an E60 (N52 magnesium 525) and previously an E39 (M54 525). Both are ori M-Sport models.
In terms of NVH, comfort, technology E60.
In terms of pure hardcore driving (not comparing with other models like the E34, E36, etc), E39.
If you are comparing both models with the same engine, better go with the E39. The E60 barge is heavier and a more powerful engine like the N52 is more suitable for the E60. The E39 has pretty good balance with the M54. At times, I even feel a 530 would be better for the E60.
In terms of driving dynamics, the E39 is much easier to drive but that's just me. I still can't get used to the E60 Active Steering. I need a full reset of myself to learn how to drive the E60. The rear of the E60 jumps on corners. Note though that my E39 had Koni adjustables and cornering was bliss. Even the CTRs and Golf GTIs got intimidated. The E60? Well, I believe it can do it, but I just don't have the guts to do it ....... YET