Hamlet's lack of opportunity is overshadowed mostly by his many reasons to delay killing Claudius. Hamlet spends much of his time in deep depression while pondering the morality of revenge--as well as the permanence of death. He first needs to come to terms with the ghost's charge to avenge his father's death, then he can think about opportunity and by way of which device to execute. One major chance that Hamlet has to kill Claudius is certainly missed when Claudius is kneeling to pray in the chapel. The situation is perfect because Claudius is all alone, he's not on guard, and he's in a vulnerable and compromising position. Hamlet finds Claudius thus situated and knows it is a perfect time for the kill. Hamlet, however, being so intelligent as he is, deduces that maybe it isn't the right time because Claudius might be receiving forgiveness in prayer and die redeemed of his sin. Hamlet certainly does not want to send Claudius to heaven; he wants to kill him when he's sinning so he won't die in a forgiven state. Hamlet rationalizes his actions by saying:
"Up, sword, and know thou a more horrid hent.
When he is drunk asleep; or in his rage;
Or in the incestuous pleasure of his bed;
At game, a-swearing, or about some act
That has no relish of salvation in't
Then trip him, that his heels may kick at heaven
And that his soul may be as damn'd and black
As hell, whereto it goes. My mother stays.
This physic but prolongs thy sickly days" (III.iii.90-98).
Hamlet, therefore, decides to wait until Claudius is performing a different activity rather than prayer to kill him, but that would have been a good time to do it, too and he misses it.
Hamlet could have killed Claudius when he was praying, even though the audience understands that Claudius was not praying. He could have killed him but he did not want to because then Claudius would go to heaven. His father wants revenge and is stuck in a dark and gloomy place, so when Claudius would be doing an activity other than praying, Claudius would be able to go to hell once he is killed.