I couldn't help myself and now I am feeling terrible about it.
You are feeling terrible because he is in agony, and you are a kind, empathetic person who cares about him.
Please take care of yourself, be kind to yourself.
As for lashing out at him under provocation, then leaving, I'm pretty sure that the outcome wasn't changed. He was going to be yelling at you until you left, no matter what you did. Leaving quickly was the right thing to do, and if you had done it before you spoke it wouldn't have made much difference.
The rest of what you are doing--not trying to save him from himself when he goes home and doens't eat or sleep, not taking his calls/texts to protect yourself, especially at night, it is all the best you can do. Stay strong.
I know you are hurting. And I believe you are strong enough to do the right thing even when you are hurting. I wish there was something I could do about your pain.