Anytime that something unsafe happens, it is good to stop for a moment and look at the situation, considering all of the events. It may or may not require leaving the range, but you do what is right for you. If you felt it neccessary, then I commend you for your safety conciousness.
For me, it would definitely require a moment to calm and collect myself, and maybe go back over the rules of safe firearms handling (kept in my guncase with other paperwork involving my firearms). We all need refreshers from time to time.
As long as you learn from it and do your damnedest not to do it again, it will be okay.
BTW, I would only be scared if you were NOT concerned about it.