FWIW, my son has had to go under general anesthesia almost a dozen times now, and the protocols that the anesthesiologists use at our hospital use now require a respiratory therapist to be in the room when anesthesia is removed, and it is done in stages, so that it is made absolutely sure he is breathing on his own before the breathing tube is removed and he is fully awakened. I'm sure part of it was driven by the fact that what you went through is both awful, and should have been prevented.
I'm saying only to let you know that I really empathize with the anxiety it can cause, and that if you ever are in need of surgical care again, perhaps you should discuss it with your surgeon or care team before-hand..hopefully they have protocols in place where you won't have to go through that again.
On another note...holy crap on the endoscopy! I can't imagine how much local anesthesia that must have taken, or how odd that must have felt!