In Shakespeare's Hamlet, not only is Shakespeare passing judgment on the value of taking action and the folly of not doing so, but literary critics have long held the same opinion. In fact, Hamlet—as a tragic hero—demonstrates his tragic flaw in his "indecision."
The basis for the concept of "action vs inaction" is Hamlet's failure to avenge his father's death quickly. The idea has been presented multiple times that had Hamlet done so, he and Gertrude, and his household, would not have died.
I struggle with this for several reasons. Hamlet is written when the audience deeply believed in the supernatural. Elizabethans were sure that the powers of darkness did all they could to win souls to their eternal damnation. Killing a king was considered a mortal sin: it was believed that God chose the monarch, and that man had no right to defy God's choice. If Claudius has killed Old Hamlet, then Hamlet is justified in killing him, but he needs proof that the Ghost is "honest."
Hamlet spends time figuring this out. After the "play-within-the-play," which acts out Old Hamlet's murder, Claudius' response is all the proof Hamlet needs. Passing through the castle, Hamlet walks by the room where Claudius is praying. With his proof of the King's guilt, Hamlet is ready to kill him there. However, Hamlet recalls that his father's ghost was suffering because he had been sent to his death without the opportunity to cleanse himself of his sins. Old Hamlet's spirit must now wander in purgatory. Hamlet refuses to kill Claudius at that moment, for with sins forgiven, Claudius would go straight to heaven. (Ironically, Claudius is unable to form his prayers at that moment, but Hamlet doesn't know this.)
...am I then revenged,
To take him in the purging of his soul,
When he is fit and seasoned for his passage?
Up, sword, and know thou a more horrid hent. (90)
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,(95)
And that his soul may be as damn'd and black
As hell, whereto it goes. (III.iii.86-97)
Hamlet soon at his mother's room. When he frightens Gertrude, she cries out. Polonius, behind a curtain in the room, yells. Finally, Hamlet—thinking that Claudius has been with Gertrude in the midst of an incestuous act—stabs the person behind the curtain. (Elizabethans believed that to marry a spouse's sibling was committing incest.) The man is not Claudius, but Polonius, and Hamlet has tried and failed to kill his father's murderer.
Once Hamlet kills Polonius, and does not kill Claudius, his fate—and that of the others—is sealed. It is true that since Hamlet does not kill Claudius when he has the chance that the King is able to turn Laertes against Hamlet. Once their plot is set in motion, those who are still alive are doomed.
In light of these events, Shakespeare believes that one must take action in a timely way or miss important opportunities. With Hamlet, I cannot help but believe he is a loyal son who wishes it was not his fate to avenge his father's death, but knows he must. Shakespeare writes his play putting Hamlet in an impossible position, when the circumstances surrounding his father's death and the limitations placed upon him, make it impossible for him to respond any differently. It is because of these things that Hamlet is a tragic hero, and the play is a tragedy.
It is not so much action vs inaction as it is thought and action more precisely resolution (or resolve) and action. We have Hamlet fully resolved to sweep to to his revenge at a number of points in the play and yet that last step is as wide as a canyon. The same though can be said of Laertes who on his return from France is fully prepared to kill Claudius and then doesn't. The same with his intent to cut Hamlet's throat in the church. In the very next scene he gets his fingers on Hamlet's throat and in the church yard no less - again he does nothing. Claudius resolves to send Hamlet to England at the end of 3.1, but Hamlet doesn't actually get sent packing until 4.4. Pyrrhus pauses in slaying King Priam and Lucianus in the Murder of Gonzago also pauses.
What Shakespeare is saying is that this quality (or frailty) is particularly human and is one of the many things that separates us from the lowly beasts that but "sleep and feed". Contrary to popular belief Hamlet's contemplative nature is not unique to him. It is in us all and as a quality it is not necessarily a bad thing. But therein lies the drama because one person's deliberation is another's procrastination. As an audience we all want Hamlet to chase down Claudius and run him through as he leaves the play-within-the-play. And again when he is seemingly in prayer, fit and seasoned for his passage.
What we are privileged to observe is Hamlet's thought process as he labors through his burdens. As an audience, having this wealth of access to Hamlet's thoughts lend the notion that Hamlet in particular has some sort of flaw that causes him to think through problems. But Hamlet's thoughts are not isolated solely on killing Claudius. Hamlet is young and immature and is searching for universal principles of what it means to be a man. He is surrounded by duplicity and ambiguity. Hamlet wrestles with ideas of love and lust, image and reality, hot blood and cool judgment, oblivion and remembrance, reason and instinct, beasts and nobility, heaven and earth, life and death, thought and action. It is no fault to puzzle through such difficulties.
Hamlet rightly gives revenge its due consideration even though his visceral reaction is to quickly dispatch Claudius. I think Shakespeare sees revenge as the savage act of an animal, hardly in keeping with noble aspirations. Prince Fortinbras' initial preparation for war was grounded in revenge very similar to Laertes reaction to Polonius' death. Prince Fortinbras in keeping with his station in life redirects his urge to revenge and turns it to the art of war. The power to lead men for the mere honor of doing so. He of course is the one who lives to ascend the throne of Denmark. On the other hand the most savage avenger, Pyrrhus, is recounted by the Players and remembered by Hamlet with bestial imagery.