|Recommended reading for sure.|
One other point. If you are looking for good tips on running horror, read anything by Kenneth Hite on the subject. Nightmares of Mine is particularly good.
We have two elements here that possess numerous commonalities, and seemingly are anathema to one another at the same time. The presence of one does not necessarily preclude the other, but the combination of the two may not be preferable. Should the two be combined, a careful hand is needed. Tricky to pull off, but plausible.
In order to make use of these elements in storytelling and gaming, there are several key parts that they share.
As Mr. Hite points out in his book, hysteria is a common component: a loss of self control triggered by an emotional response. Fear in one case, laughter in the other. It could easily be said that this state of hysteria is the intended goal, but that is a case by case kind of thing.
Setup is also important. For comedy this would lead into a 'punchline'. In the case of horror, this would be the buildup of atmosphere. The idea being that the mind of the audience is being lead to a necessary point in the psychological process, such as a false sense of expectation, or being set on edge.
Timing is also crucial for both to achieve maximum effect, most often through the element of surprise. It's the moment between the setup and the point of impact.
The unexpected causes the audience to have to readjust suddenly to that which they were unprepared for, thus upsetting mental balance and inducing hysteria. Catching the audience off-guard is more than just trying to startle them, though. It's using the setup to create a blindspot of sorts in the targets mind. Misdirection is incredibly useful.
Combining the two has some interesting effects. Either has a decidedly sobering effect when following the other. Humor is often a coping mechanism for traumas such as terror or anxiety. Likewise, people tend to stop laughing when suddenly faced with something terrifying.
The darker side of comedy is black humor and gallows humor. Humor that utilizes bleak and solemn subject matter, often employing a sense of cynicism. Not everyone finds these kinds of things funny, but plenty of people like to indulge from time to time. This type of humor can also be used to further enhance a horrific scenario if timed well. Horrific things done with a sense of irony or a villain making inappropriate jokes might be some examples. In combining horror and comedy, care must be taken to ensure the desired tone is not compromised, nor is the audience turned off by the ordeal.
There it is folks, raw and unpolished. Merely food for thought. Eat well, and stay classy!