A lot of people think that a play is classified as a comedy if funny things happen throughout, but a play can be considered a comedy for much simpler reasons. "The romantic comedy was usually based on a mix-up in events or confused identity of characters, particularly by disguise." A comedy means that the protagonist(s) ended up happy/alive at the end of the play. This is obvious in Twelfth Night. In fact, Shakespeare almost overdid it. It was almost corny how every character ended up content with the outcome. Malvolio provides the exception, but that contributes to the protagonist(s) ending up happy at the end of the play. Malvolio was the character for whom that you did not feel a lot of sympathy. So, watching him feel frustrated at the end of the play enabled us to close the book feeling happy. .
In some comedies, the story can be far-fetched from reality. Things happen that usually wouldn't, just to make the story make sense. It seems you"re constantly realizing how convenient things seem to be. "Sometimes the comedy depends on exaggerations of man's eccentricities- comedy of humors." A comedy will also consist of many dilemmas, and each will seem like they won't be sorted out and disaster will strike; however, something usually happens, something illogical or not predicted, just in the nick of time to save the day. If this didn't happen, then it wouldn't be a feel-good play, making it something other than a comedy.
In Act III Scene i, dramatic irony played a big role again, developing Viola's desire to admit her disguise.
Olivia. I prithee, tell me what thou think'st of me.
Viola. That you do think you are not what you are.
Olivia. If I think so, I think the same of you.
Viola. Then you think right; I am not what I am.
Viola's words are barely meant for Olivia, but more or less for us, the audience. Olivia just thinks the two are engaged in a little tongue-twister battle, when in fact, Viola's words have a much deeper meaning.