Congratulations on trying to stay clean. I hope that if you stumble, you will continue to try again as often as you need to.
Now, about your question.
I see what you mean about near-death. I haven't actually died and been revived or even come as close as you. But I have had instances where I thought death was imminent (once on a haywire amusement park ride and once in an emergency room where I thought I was having a heart attack). And I have held both my father and my husband in my arms when they died.
I believe that any experience can change you; it doesn't have to be near-death. But for some people, only a threat to their very existence will get their attention. And this is where I think you were. It's possible to satisfy one part of your physical self while damaging the rest. Your near-death experience awakened you to the fact that you are the sum of your parts all of the time, not just this part at this time and another part at another time. Learning that is scary and yet that "opening up" can make the world more wonderful to live in by leading the way to other discoveries. For me, this has been the great lesson of my losses.