Hamlet is determined to avenge his father's death and to fulfill his promise in terms of the ghost's words; "Revenge his foul and most unnatural murder” (I.v.25). Hamlet has no intention of allowing his mother's marriage to his father's brother go unpunished, especially as Claudius is "A little more than kin, and less than kind" (I.ii.65) but he must hide his disgust which is perceived as depression and even madness. This suits Hamlet's purposes, allowing him to plan his revenge.
Hamlet's famous soliloquy in Act III, scene i, begins with what must be the most famous words in all literature as he says, "To be or not to be - that is the question" (56). Hamlet ponders whether life or death is preferable such as he also contemplates earlier when the burden of not only his father's death but his mother's actions is almost too much to bear as he says, "How weary,... and unprofitable, Seem to me all the uses of this world"(I.ii.133-134). In Act III, scene i he is taking the concept one step further as he suggests that he and many others would choose suicide over a complicated existence but "there's the rub" (65). The problem is the uncertainty that life after death will be any less complicated, and this therefore "does make cowards of us all" (83).
Shakespeare uses repetition by consistently making the comparison between sleep and death as being one and the same. Sleep is torment for Hamlet and so is already possibly worse than death but the uncertainty of what may be contained in "that sleep of death" (66) is enough to stop anyone. This places great emphasis on Hamlet's state of mind and develops his character without Hamlet having to make any direct reference to his own state of being. It is unlikely that he knows that anyone is listening and the repetition shows his ability to rationalize even as he struggles with his own living nightmare. This allows him to distance himself from his own problems which would otherwise consume him. Using repetition also highlights the fact that there can be no real resolution.