I actually got the idea from a bioethics discussion I attended a week or so ago at my school. The trolley problem itself is really old, and the twist with the doctor I'm sure isn't original either, so maybe the bioethics guy leading the discussion got it from somewhere else.