OK - what did I not understand?
This is what I got from your post...
There are two possible uses of "delusion" - one is where someone believes something that turns out to be false (it could be argued that this is not a valid application of the word 'delusion' because the usual use of that word requires that there be compelling contrary evidence - but never mind that we'll leave it in for now).
The second is where the delusion is psychotically-induced (which could be because of mental illness which you mentioned, or because of drug use which you did not mention). Am I right so far?
You argued that the first application could work either way in religious applications - e.g. we could believe there is a God when in fact there isn't one OR we could fail to believe there is a God when in fact there is one. The problem here is where is the compelling evidence either way? But still, in this case even if there were compelling evidence one way or the other, could it not simply be that someone who was wrong about it was simply mistaken - not delusional - just misinterpreting the evidence. If that is what we mean by "delusion" then we are all delusional very frequently aren't we? And the messages of previous Manifestations become increasingly delusional as human knowledge advances - doesn't it? But again, lets just leave it there for now.
You then argued that the Bab (and Jesus, Muhammad and Baha'u'llah) could not have been psychotically delusional because they were able to function successfully in other aspects of life...such as what?...are you suggesting that because someone is able to tie their shoe laces, maintain a physically healthy diet and lifestyle, write letters and cross the road safely they cannot possibly be mistaken about the existence of God? And yet there a millions of atheists who are entirely capable of doing all this and more - and yet they believe the exact opposite of what you seem to think is proven beyond any reasonable doubt?
So again - what did I not understand?
Delusions that are associated with mental illnesses is a symptom. It can be severe or mild delusion. It is not like all people who have delusion, is due to the same mental illness.
It can be bizzare or non-bizzare delusions.
It is known and you can research it, that delusions which are hallucinations are due to sever mental problems. In fact those mentally ill people who believe to be God, or chosen by God, are often those who have schizophrenia. Such mental illnesses would make the person incapable in other functions too; memory problems, communication and reasoning,..etc. It is true that there are many who have delusions while still functional in other areas, however those are the people with minor and non-bizzare delusions. For instance a person may be suspicious and think some people are making conspiracy. This is a minor delusion. But if a person hallucinates and sees things which are not there, or believes without doubt he is God or Messenger of God, this is no longer a mild form of delusion. You can research it.
It is like saying, most of us in our life will have some breathing problem, but it is due to minor cold and does not effect our function. However, when breathing problem is severe and persistent, it is no longer due to just simple cold. It would be perhaps long cancer, or fluid in the long, a more serious condition which makes the person incapable of living normally.
It may be interesting to know that, one of the Prophecies in Islamic Traditions says, when the Mahdi appears, people think He is a madman, a crazy man. Now, see how this came to pass; the Bab who claimed to be the Mahdi of Islam, was imprisoned. Before they execute Him, they said let a doctor visit Him. If doctor recognized He has a mental illness, then we know His claim is only due to His mental illness, and we do not have to execute Him. Then they had a British doctor visit Him. After that the doctor said He is a pleasant and healthy young man. Then they executed Him.