That is Law, and as always is the case with Law, it functions for our good only when, as Paul put it, we "use it lawfully." It can do damage if we misuse it.
Being obsessed with the self is pride. OCD will seek occasion to make us feel guilty about obsessing because it means thinking about ourselves. It will lose track of the fact that we obsess because of a neurological condition which can have spiritual ramifications, not a spiritual condition as such. And of course, it will lose all sight of the fact that the whole problem is that a person who is paying attention to how he or she is doing spiritually is fixated on himself (or herself) and isn't looking outward, to Jesus, Who is the only righteousness we have or ever will have, and to our neighbor.
But that's the whole point! We don't have a duty to obsess about whether this or that is a sin, or how well we're doing in the sanctification department. In fact. doing that only makes things worse. We have a duty not to do that! But our tendency to do it anyway is prompted and reinforced by a medical condition.
But there's no mistaking the element of pride in religious obsessions. Who, after all, is as proud as the person who thinks that his or her moral sense is better developed than God's, and who cannot forgive himself or herself in spite of the fact that God Himself has? Who is nearly as proud as the person who doubts that the promises of Jesus to forgive and to save all those who believe in Him apply to him or to her, because he or she is an extra-special, super-duper sinner who is SOOOOOO bad that they might be the ONE EXCEPTION to those promises- even the ones which specifically state that there are no exceptions?
The Reformers talked about three "uses" of the Law. The First Use of the Law is to intimidate even psychopaths into limiting their victimization of others by making them afraid of somehow being accountable. Sometimes fear can deter even people who lack a sense of right and wrong.
The Second and most important "use" of the Law is to break us, to attack precisely our pride by driving us to despair over our ability to do what people with OCD torture themselves by trying to do every day: "fix" ourselves by our own efforts and stop being a sinner. Three cheers for the Second Use of the Law! Only it brings home to us both how broken we are spiritually and how impossible it is for us to "fix" ourselves are we able to see our need for Jesus. And when we find ourselves slipping back into the pattern of turning our gaze inward and obsessing about the condition of our own hearts and the minutia of our behavior, we need it to break us once again and convince us every day, if necessary, that it ain't gonna happen- that in focusing on the condition of our own hearts and our own behavior we will find only failure and death.
As the Second Use of the Law, Lewis's comment that humility means thinking of ourselves less reminds us that all we'll discover by thinking about ourselves is sin and death. It shows us that we will find no answers there and instead drives us to do exactly what we have failed to do: stop focusing on ourselves and focus instead on Christ.
The Third Use of the Law is controversial. Luther never spelled it out, though he often implied it. Certainly, the Bible is quite clear about it. Driven to Jesus, and taking refuge in Him, we no longer are threatened by the Law. We no longer have to focus on ourselves and how well we're doing or not doing. We're free to think about God and our neighbor now, instead of about ourselves. So what should we concern ourselves with where God and our neighbor are concerned?
Now comes the Law again- except not as an accuser, but as a helpful friend. It can't accuse us anymore since we're finding our righteousness and the answer to everything it demands in Jesus, and have no need to look obsess about the condition of our own hearts, where we already know we will find only anguish and despair and failure and death. So instead, the Law tells us, whom it can no longer accuse, how to spend all that energy we've been wasting worrying about how we're doing and whether this or that harmless action might for some far-fetched reason be a "sin-" as if anything a sinner does could, in itself, not be contaminated by all that decay and corruption and spiritual pus that we've been lovingly stirring all that time in the hope that we could somehow fix ourselves! Now we have time for Christ and for our neighbor! Now we look to them, think about ourselves less- and discover that therein lies peace.
OCD is a neurological condition, not a spiritual failing. The problem isn't as simple as uncomplicated pride. Fixating on ourselves is pride, but it's not pride which causes us to fixate on ourselves. For all the spiritual damage obsessing does by driving us in on ourselves, it's not fundamentally a spiritual problem because it's caused by our broken brains, not by our broken hearts. But the obsession with oneself and with one's own hear and behavior which manifests as pride finds a perfect resolution in the fact that when we're convicted of our pride. the Law in its Second Use causes us to despair of ourselves and be driven to the Gospel, to Jesus. And there, we find not only the remedy for our pride but even for the OCD-driven habit of thinking so much about ourselves.
We are given Jesus and our neighbor to think about instead. Instead of thinking less of ourselves, when we find our righteousness and our healing in Jesus and our the focus of our lives in the needs of our neighbor, we end up thinking about ourselves less. The result is peace, freedom, and the very holiness which we had been trying and failing for so long to work within ourselves by our own compulsive worrying and fretting,
When your OCD accuses you, instead of letting it drive you to anxiety and depression and a fearful striving to be what you can never make yourself, let it drive you to Jesus. Let Him be your righteousness. Let Him bear your burden. Let Him free you from the burden of thinking less of yourself by enabling you to think about yourself less.