There are many very good books on writing comedy for contemporary audiences. And the history of comedy can also help polish skills in effective comedy. Although writing comedy well is useful to the fiction writer, for the most part, it is the embodiment of the essence of humor in the fictional story that compliments the fictional story purpose, without comedy becoming the prime reason for the writing. A limerick, for example, is always fun. Using a limerick in a fictional story successfully–without stopping the story flow–would be tricky. Yet, full knowledge of how and why a limerick makes us laugh is of great value even in a tragic fictional story when the author is striving for excellence. Thanks for your comment. WHC
In the study on humour and psychological well-being, research has concluded that high levels of adaptive type humour (affiliative and self-enhancing) is associated with better self-esteem, positive affect, greater self-competency, as well as anxiety control and social interactions.  All of which are constituents of psychological wellbeing. Additionally, adaptive humour styles may enable people to preserve their sense of wellbeing despite psychological problems.  In contrast, maladaptive humour types (aggressive and self-defeating) are associated with poorer overall psychological wellbeing,  emphasis on higher levels of anxiety and depression. Therefore, humour may have detrimental effects on psychological wellbeing, only if that humour is of negative characteristics. 
To these counterexamples to the Superiority Theory we could add more. Sometimes we laugh when a comic character shows surprising skills that we lack. In the silent movies of Charlie Chaplin, Harold Lloyd, and Buster Keaton, the hero is often trapped in a situation where he looks doomed. But then he escapes with a clever acrobatic stunt that we would not have thought of, much less been able to perform. Laughing at such scenes does not seem to require that we compare ourselves with the hero; and if we do make such a comparison, we do not find ourselves superior.