In writing Hamlet, Shakespeare appears to have embedded lines that comment on the play itself.
Connect these lines, in which Shakespeare appears to have enjoyed his own cleverness, to the play itself.
Shakespeare often created lines of text and situations in his plays that mirrored the theatrical world in which he worked: boy actors who played women dressing as boys, plays within plays, and comments on the Globe (meaning both the world in which man lives and the theatre building in which the actors performed). So, I can definitely provide you scenes and lines that make reference to and comment on the theatrical world of the play.
The first, most obvious comment is made by Hamlet to and with the troupe of Players who arrive at the castle. In Act II, scene ii, after the First Player has given his speech about Hecuba, Hamlet has a soliloquy in which he comments on what the First Player has been able to do, that he is unable to do. He says:
. . .What would he do
Had he the motive and the cue for passion
That I have?
This suggests that the actor playing Hamlet (along with the character himself) is commenting on the other actor's (the one giving the speech as the First Player) ability to be genuinely moved by imaginary circumstances, while he cannot. Of course, there is also the meaning regarding the character Hamlet's situation in the plot of the play.
This commentary on the play itself continues when Hamlet prepares the Players for thier performance before Claudius. In Act III, scene ii he is giving advice to the characters "The Players", but also, potentially, to his fellow actors playing "The Players." He says:
O, it offends me to the soul to hear a robustious peri-wig-pated fellow tear a passion to tatters, to very rags, to split the ears of the groundlings, who for the most part are capable of nothing but inexplicable dumb-shows and noise.
Here he lays into one of the actors (Maybe the First Player who displayed all the tears and emotion back in II, ii?) for being too over-the-top emotionally. He also addresses the real life audience when he comments on the groundlings.
And then, during the performance of Hamlet's play in Act III, scene ii, The Mousetrap, the characters make comments about Hamlet's play that are also comments on the situation of the play itself. The most notable of these is when Gertrude says, "The lady doth protest too much, methinks." This statement could easily describe Gertrude's own words in the scene that she has in her closet with Hamlet that will follow the play as well as the words of The Player Queen.
Shakespeare often made reference to the theatrical world that his plays existed in through the text and actions of his characters. In Hamlet, much of this commentary revolves around the arrival of The Players to the castle and their performance of The Mousetrap. Please follow the links below for more on the play-within-a-play in Hamlet.
Imetcalf's answer the other day and the above recall the response from Polonius to the speech from the player in Act 2, scene 2: "This is too long"(2.2.489). HAMLET is by far Shakespeare's longest play. Another thought from Polonius that, out of context, might be thought to have come from the commentary is "But yet do I believe / The origin and commencement of this grief / Sprung from neglected love"(3.1.177-179). Hamlet's lines from his speech to the players, "the purpose of playing, whose end, both at the fiirst and now, was and is to hold , as 'twere, the mirror up to nature"(3.2.19-21), is interesting. Elsewhere, Shakespeare suggests that his purpose "was to please"(THE TEMPEST, the Epilogue).