I dealt with the same issue on a personal level. My grandmother had an AICD, and when we put her on hospice, the MD ordered the pacemaker rep out to "d/c" it. But he didn't write whether to d/c the pacer, the defibrilator, or both. The pacemaker rep disabled the defib but refused to stop the pacer itself, citing that a pacer will not keep a dying heart from dying. I argued that there was no need to have the pacer in a woman who was in MODS and expected to pass at any given moment, completely unresponsive (for days), DNR in place, literally with her family surrounding her, ready to go.
I should back up a bit and say that the pacemaker rep took forever to get there to turn the AICD off--12 hours in a patient who wasn't expected to even live another 12 hours. I had already had my brother go to the local Tractor Supply and buy me a big magnet. (I found it odd that the hospice nurse didn't have one? Is this not something they deal with on a fairly regular basis? Maybe not.) I refused to let my mom and her siblings see their mother being shocked just because the pacemaker chick couldn't find it in her busy schedule to get there and turn it off.
Anyway, to the OP, I think it was a huge oversight that the MD didn't write to have the pacer d/c'd in the patient. It was cruel and awful that the patient suffered and wasn't allowed to die as a result of this MD's negligence. You did the right thing. In my experience with dying patients, sometimes it takes a bit to begin to feel like you did the right thing.
And, yes, 20 mg of Morphine, not 4 mg. Everytime.