This question makes no sense, because you are viewing the situation in a legal sense. (and consider heaven and hell as places instead of states of being)
If you stick to the legal sense that your original question uses, then I would simply point out that "insanity defense" is legit in modern legal systems and why would God be less merciful than us humans?
However, I will actually stick to the fundamental frame issue as it is more useful for you and other readers.
Frame issue: Salvation is not a legalistic "system". It is a love based "system"
From the Eastern Orthodox perspective questions like this are "non-questions" because God is Love. As I am not an "infernalist", I believe that God truly does not want anyone to perish. I believe that the fires prepared for satan and his angels are the purifying fires of love. There will be Apokatastasis.
This position is one that is not clearly defined within the Eastern Orthodox Church and I am only presenting the side I personally believe. Both "inclusivist and exclusivist tendencies have characterized Orthodox theology for hundreds of years. However, I personally find the exclusivist tendencies to have a "god that is too small". -Wyrsa
Within the many ikons of the Last Judgment they depict Christ surrounded by all people and angels, seated in glory and light with books opened by his angels as well as the demons thrown into the eternal fire. The scene is not a “threat” to be good, but a revelatory reality that Christ has been given the authority to judge by God the Father. This teaching is not a fear tactic to manipulate us into being good. Mercy flows out of the heart, not a coercive act of kindness.
John Chrysostom teaches that “our thoughts will stand forth…[to] condemn … exonerate us.” Christ is the judge, but not the condemner. He reveals each person’s nous, their heart, and He reveals humanity.
The Orthodox church teaches that all have been given enough of their own judgment to decide what is right or wrong. So for Jews, they will be held to the words of the Law. For Gentiles, they will be held to their inner law, what we call a conscience, or inner knowledge. Christians are judged by the Gospel of Christ. All of these moral criteria come from the Most Holy Trinity, not merely a theory of natural law.
All cultures follow a way of behaving, a code of morals that have been given to understand God the Creator in our actions toward others, no matter what level of light is given to our minds. Whether by Law, Conscience or Christ, the soul is assumed to exist. Basil the Great teaches that our bodily actions become imprinted on our soul like a painting, and that we are all judged by people who lived in similar situations and positions as we did, since cultures vary, and we are born into different times and places. There is no room for rebuttal of unfairness. Even the mentally ill will be judged, but they will be judged fairly.
No one is deprived of God’s love after death, even in Gehenna, teaches Isaac the Syrian in his Ascetical Homily 18. That God wills universal salvation of each person is scriptural (For God does not wish for any to perish...)
Protopresbyter Georges Florovsky teaches that there is only one possibility: all will experience God’s eternal, unchanging love.
Short Answer: Mental illness doesn't damn us to the state of hell. God isn't waiting to leap out from behind a bush and say, "Gotcha!" he is standing openly with his arms wide for everyone. Mental illness is no different than any other illness. A schizophrenic isn't responsible for their hallucinations and delusions any more than an Alzheimer's patient is responsible for their memory loss. Mental illness is one of the crosses some of us have to bear. God loves and understands.