Hi, and nice to cybermeet you. A lot of us here have a story like yours -- one night, one decision, suddenly blew the lid off the unsustainable life we'd been living for a long time.
It can be the best thing ever to happen to us if we make it the turning point. Keep on using these events to your advantage and you'll come out with a better marriage and a better job than you ever could have landed in your previous "high functioning substance user" life!!
So I'm not gonna say "Sorry this happened." I'm gonna say "Glad this happened and congratulations! Welcome to the rest of your life!"