I don't think Hamlet fears being killed for killing Claudius. More likely he fears what his death would be like should he kill Claudius and make an immoral choice in doing so (Hamlet is, among other things, plagued by uncertainty that the ghost is telling him the truth). Will he be dooming his soul? His contemplation of suicide is emblematic.
There is a difference between actually being suicidal and pondering the idea of suicide.
There is nothing in the play to suggest Hamlet wants to be dead. There is also nothing in the play to suggest that Hamlet's inaction in killing Claudius is caused by his fear of being killed in retribution. Hamlet's inaction is based on conscience, uncertainty in knowing what is right. He neither seeks death nor is he afraid to die if it is the right thing to do. But he is not sure it is the right thing to do.
The line in the soliloquy that is key here is "Thus conscience makes cowards of us all." Hamlet, is, per usual, philosophical, thoughtful, contemplative. It is not surprising that he thinks about what death means.
The reason he ponders the choice to die is because it is emblematic of willfully doing something with an unknown consequence. And, in this case, an action which might doom his immortal (or is it?) soul if he is an agent not of heaven's retribution but of hell's. Thus, exacerbating the potential for a painful and doomed afterlife (if in fact that is what happens to those who make immoral choices) should he be sinning in killing Claudius by exposing his soul to torment in death.
Goes without saying, but just my interp.
Just as Hamlet chooses not to kill Claudius while he is at prayer lest Claudius go to a peaceful shriven death, Hamlet ponders the uncertainties of death as a function of sin and penance in light of his own potential act of killing his uncle. The pall of regicide, coupled with the uncertainty of the murdered monarch's guilt has a clear parallel: Elizabeth's indecision to execute Mary, her cousin and her possible fears for her soul after Mary was beheaded. Reportedly Elizabeth seriously, religiously questioned what having killed her cousin Queen Mary would bode for her soul's eventual rest.
In addition, what follows in two scenes builds further on Hamlet's uncertainty and reinforces his concern over the ethics of his action (and, by extension what his eventual death will mean for his soul) i.e. his meeting with the players and resolve to test Claudius's guilt through the king's reception of a performance of Murder of Gonzago.
Updated On: 1/30/13 at 08:43 AM