I've never had this happen to me, but I've been in situations where I think I could have. ie, I realized that if I thought too much about where I was and what would happen if I fell, that I would probably have panicked.
So I don't think about it.
Now, that's a very flip response, and of course tongue in cheek, but also true. I think you have all broken it down in different words. You have to narrow your focus to only what you have to do next. The overall picture is there, but it must go to the back of your head, like your peripheral vision. It's there, but you cannot look at it. You have to sense it (the danger, the consequences, whatever), but you are forbidden from turning your head to look at it.
So do the thing you have to do. One turn, one edge set, whatever it is. Stay in the traverse, don't look down the hill. Don't imagine anything. I think someone earlier described it as what's 8 ft in front of you.
It is a balance, because you do have to have the overall picture, before you go 8 ft, then another 8 ft, then another 8 ft, and then oops a cliff. But once you've taken stock of the situation, then just focus on what's before you.
Interestingly, the one time I did have the rising panic start was when I was with my then-9-y-o son and we were cliffed out at Whistler. Well, I guess that's pretty normal. HE was fine, of course, but I felt that loss of control over the situation and the fear of what-if that I am usually able to control.
He was calm and perfectly able to turn around and navigate the narrow icy chute out of there (140 cm skis are useful in such situations, no?). After that, I felt much better about his behavior in sketchy situations. You never know until you've been there, I guess. Daughter tends to get more panicky, though.
[I want to add this ... which piggybacks onto Mollmeister's post: I think the irony is that often, the more dangerous situations you are capable of putting yourself into, the less danger you will actually face. What I mean by this is that most of us eventually reach the point where we are too risk averse to do anything that truly scares us. Because it isn't a steep bump run anymore that is scary, it's a real, honest-to-goodness no-fall zone, or another situation in which the worst consequence could be grave.
Now, this isn't to say that some of us don't spend a lot of time in such places, and I spend even a little tiny bit, but it takes a pretty serious consequence to make me turn back these days. But I just don't put myself in those situations. I have no need for the risk anymore. I can get my kicks just fine otherwise. I also have two kids.
So -- I'm not minimizing anyone's fear of a less dire circumstance, don't get me wrong. Far from it. What I'm saying is that as we improve and gain experience, most of us will hit a ceiling to where our capabilities are actually higher than our fear level. (Does that make sense?)]