The human brain is an organ just like the heart, kidneys, lungs, etc. It is prone to disease and abnormalities just like any other organ. Unfortunately, many religious people are deluded into believing that only certain diseases of the brain are legitimate, but others aren't. For example, no one says that the person with a neurodegenerative diease such as Alzheimer's or Parkinson's are possesed by demons or that they are suffering the consequences of poor life decisions, but many religious people, when they see someone with hallucinations or deluisions, they automatically assume a whole host of things about the persons life and spiritual state. We have to be careful. But I am speaking of profound mental illness here.
And William, to your question, it is a difficult one. I am no theologion or philosopher and don't particularly have a way with words, but one thing I do know is that God loves all, desires that all be saved, and he goes to the very depths of hell at every moment of every day to save his children. There is nothing that God won't do for us. If a woman curses God, not because she means it, but as a result of her mental deterioration, it is not truly a curse. Curses come from the heart.