Interesting question.
My initial thoughts are that I would believe we would have to understand what we are doing, be mentally sane, in order to realize we are sinning, but I don't have any Scriptural reference at my fingertips for these beliefs at this moment.
What I might would ask is how does the depression, mood disorder or mental illness come about? What causes or caused it? Is it sin that causes it or caused it and would that even be relevant?
I think about how various people in the Bible could have easily been and probably were depressed after certain actions, some most sinful actions... particularly Adam and Eve after eating of the tree, or David after his sin adultery. Sin caused their guilt and depression.
I will defer to others who can probably give you a better answer, but
this article from Apologetics Press might be helpful.