Such an interesting change in Hamlet occurs during these short lines! Hamlet, of course, has rewritten and switched the letter that Rosencrantz and Guildenstern were to carry to England. This letter was to be the death of Hamlet. Hamlet turns it into the death of Rosencrantz and Guildenstern. Hamlet is surprised at how smoothly this "changling" happened and talks, quite interestingly, about fate:
Our indiscretion sometime serves us well / When our deep lots do pall, and that should learn us / There's a divinity that shapes our ends, / Rough-hew them how we will. (5.2.8-11)
Hamlet seems empowered by what has happened and feels as though some "divinity" is on his side, as if fate has allowed him to live through this tragedy. I find in incredibly interesting that Hamlet specifically says "our indiscretion sometimes serves us well" because I am one who believes Hamlet's major flaw to be inaction. Hamlet thinks too much, you see. Here he finds when he doesn't bother thinking before he acts, he truly gets things done! How humorous!
Hamlet also takes this idea further:
Does it not, think thee, stand me now upon--/He that hath killed my king, and whored my mother, Popped in between th' election and my hopes, / Thrown out his angle for my proper life, / And with such coz'nage--is't not perfect conscience / To quit him with this arm? And is't not to be damned / To let this canker of our nature come / In further evil? (5.2.63-70)
In other words, Hamlet asks Horatio if he thinks that Claudius deserved this twist of fate, considering what evils Claudius has done. Hamlet feels no guilt (as he has shown in the past) for the deaths of Rosencrantz and Guildenstern, since they were so eager to follow Claudius' evil ways. In Hamlet's eyes, payback was deserved!