As far as letting a medical doctor on the flight deck, 14 CFR 91.3 is pretty clear:
(b) In an in-flight emergency requiring immediate action, the pilot in command may deviate from any rule of this part to the extent required to meet that emergency.
Actually, I believe the more pertinent reg in this case is:
§ 121.557 Emergencies: Domestic and flag operations.
(a) In an emergency situation that requires immediate decision and action the pilot in command may take any action that he considers necessary under the circumstances. In such a case he may deviate from prescribed operations procedures and methods, weather minimums, and this chapter, to the extent required in the interests of safety.
I'll certainly agree that it's wacky to worry about cockpit door regulations and legal jurisdiction when someone's life might be at stake but that's the modern CYA workplace that we now operate in.