You handled that really, really well. One of the hardest things to do is to not jump in and rescue them, and yet many of us do, and still others come across as just a cold distant AZZ, which is not what you're looking for either.
"I love you, I hate to see you hurting, but I won't rescue you, this is your decision" is absolutely the way to play it.