"This feels like the ending of a Shakespearean comedy"

 Shakespearean comedies, such as As You Like It, Much Ado about Nothing, and Twelfth Night, make use of multiple interwoven plots, and often involve deception and mistaken identity, coincidence and confusion, and thwarted-but-eventually-won love. They always end happily, with an explanation and resolution and also usually a wedding.