One option for including a sanity metric in D&D is to simply add a Sanity attribute like in Call of Cthulhu. But, in order to preserve the simplicity and spirit of old school D&D, I might argue for using Wisdom as a measure of sanity. Wisdom is a sadly underutilized attribute anyway, why not do something fun with it? Potentially madness-inducing situations could call for a roll against Wisdom - roll your Wisdom or under using a typical bell-curve d6 attribute check:
Somewhat creepy: 2d6
Pretty freaking nasty: 3d6
Brain meltingly horrific: 4d6
Rolling over your Wisdom would result in losing a point of Wisdom. To adjust for experiential adventure-hardiness, a character's level can be subtracted from the dice roll.
Once a PC goes below 4 Wisdom stressful situations would induce side effects similar to a Confusion spell. If Wisdom gets to 0 the PC goes permanently insane. To soften the effects a bit, Wisdom lost in the dungeons could be regained through some DM-determined period of R&R after the adventure.
There are a lot of ways DMs could house rule the effects of horror-induced Wisdom decay. Fear? Confusion? Paralysis? A psychotic reaction each time a Wisdom point is lost, or maybe only when certain lower Wisdom thresholds are crossed...? Interesting to think about.
Of course this would all change the flavor of the game tremendously, and bring it more in line with the nihilistic tone of Call of Cthulhu where most PCs end up dead or insane. I'll be the first to say this would not be to the taste of many traditional D&D players. It would make sandbox-type "elective adventuring" very difficult - PCs would have to be on life-threatening do-or-die missions to justify the risk of madness. For this reason it would probably not be desirable to include a sanity mechanic into my own campaigns at this time - it would make the players too timid I think.
Or maybe D&D PCs should be assumed to be insane from the start? Who else would wander into a place like The Tomb of Horrors?
MEAN TEACHER PLAYS WITH MADNESS, GETS LOST IN DUNGEON, WATCHES MTV