A lot of the discussion has been on, well... "mechanical" terms about the brain and it's functions. It reminds me of the discussions from years ago about where exactly in the biological cortex the intellect lives.
Mental illness is indeed about brain chemistry and neurological linkages and misfiring synapes, but let's assume that what makes a person a person is more than just the mechanical "hum of it's parts".
Talking of ghost is a game of what if, predicated on the belief that something survives after death.
Let us also assume that which survives is that vital spark which makes you, "you" as it were.
Every quirk, mannerism, experience, every scrap of knowledge that you have accumulated up to the final moment. If your experience and world view has been afflicted with a mental or behavioural problem would that also form part of the tapestry of "you". It would be part of "you" and continue on as remembered behaviour.
Okay so unfortunate who was afflicted in life, continues to be afflicted as an apparition or entity following my theory. Could a rational person go gaga as a ghost?
Humans are sociable creatures. Even the loners amongst us have a small spark within them that craves companionship. Richard Dawkins can argue with his selfish gene theory that this is fufiling a biological imperative to reproduce, like acts of altruism ensuring that the "good" genes survive.
Okay - no suppose that our sociable human is removed from the corporeal dimension, no longer able to fully interact like the ration being they once were but still able to percieve the world. How long would it take to go "insane".
For example the repeater apparitions. What if it's not just a stone tape. What it those involved have only a moment of interaction with the corporeal dimension, in which they have to constantly repeat the actions leading to their demise - fully conscious of what's about to happen again and again and unable to avert it.
May be those ghostly screams aren't echos and didn't happen the first time through...
On the other side of the coin though - how about the apparitions which appear sentient, cognisent, calm and able to have a rational conversation with witness despite have undergone, or indeed at that moment undergoing a traumatic and painful demise ? Why are they often wearing clothing familar and associuate with them but not necessarily what was worn at the time of the demise.
Pehaps that there is a chance, a small chance that our surviving self can deliver on last message. By phone or in person, where "you" would want to appear as familar, or comforting in a well loved jacket or shirt. Once last final time to contact someone we cared about or have deep affection, that final impulse to say "before I go, I just want to tell you......."
Peharps the reason that ghosts go insane is that we don't all have that one person that we would want to contact no matter what.