Although this could be considered an example of personification, the lines within context also represent situational irony.
These lines fall within Act 3 Scene 3 of Hamlet and at this point, Claudius has just finished viewing the play within a play that Hamlet has devised to determine his guilt. Overcome with emotion, Claudius is found praying for forgiveness. Hamlet finally has both the truth (the ghost was right and Claudius murdered Hamlet's father) and the opportunity (Claudius is alone) for his revenge. However, he decides that he cannot kill Claudius at this moment because according to his beliefs, people killed while praying go straight to heaven. So once again, Hamlet delays and leaves Claudius alive.
When Hamlet exits, Claudius delivers these lines, and the audience learns that Claudius wasn't effectively praying at all. His words had no repentance behind them; he didn't mean what he was saying. This is similar to the saying that one can "feel his prayers bouncing off the ceiling."
Because Claudius isn't repentant, Hamlet could have followed through with his plans at this moment and killed Claudius. Nothing is standing in his way, after all. Since he doesn't realize this, the lines create situational irony.