What was Shakespeare's intention when writing Twelfth Night? What's the mysterious important point he wanted to demonstrate, and what's the background of the story in general?
Romantic comedy had a history in Italy before Shakespeare popularized it in England. Just like Chaucer before him, Shakespeare drew upon sophisticated Italian sources and some French sources for his inspirations and plots. In the case of Twelfth Night, Shakespeare's background source was the prose story "Apolonius and Silla" by Barnabe Riche (which also drew on earlier sources).
Shakespeare's literary intention in writing Twelfth Night was to present a romantic comedy that explored the theme of love as excessive, full of madness, short-lived, albeit true and as inspired by first sight, music and beauty. Shakespeare presented this theme by crafting classic character types such as the romantic hero, romantic heroine, and the "sour character" embodied in Malvolio, whose misfortunes may very well always represent the culmination of love when viewed through the love as madness theme. The mysterious important point represented by this theme is that love is madness and that it begins irrationally and ends with misfortune and disaster.
It’s impossible to say for sure what Shakespeare’s intention was in writing the play. He didn’t say, at least not to anyone who wrote down and preserved what he said. Writers sometimes write to make a specific point, but just as often they find themselves drawn to an idea for a plot or a character and aren’t themselves sure exactly why, they just feel compelled to write about it. The playwright Harold Pinter often spoke about feeling as though characters introduce themselves to him in his imagination and tell him what they want to say, and his job is simply to transcribe it. As bizarre as that sounds, the feeling that the characters are telling you the story instead of the other way around is shared by many authors. Was there a “mysterious important point” Shakespeare was trying to make? Possibly, but if so, he hid it well: one of the reasons that “Twelfth Night” is still popular is because it contains myriad points of view; the play contains so many possibilities in performance that even 400 years later, they have yet to be exhausted.