Jimmy Akin answers a reader’s question about scrupulosity and in the process, I think, clarifies some stuff about the importance of good works.
Good works, therefore, are not of themselves necessary to remain in a state of grace. They may help you stay in a state of grace by building good habits that steer you away from sin, but a lack of good works IS NOT A MORTAL SIN. If you are a baptized baby and you die before you are capable of doing good works, you don’t have any, but that doesn’t keep you out of heaven. Similarly, if you’re an adult convert and you get baptized and then run over by a bus so that you don’t have a chance to do good works, you don’t get kept out of heaven.
The key to going to heaven is our reception of and remaining in God’s grace. It’s his grace that gets us to heaven.
Good works are a natural outgrowth of his grace working in our hearts, and he rewards us for cooperating with his grace in doing good works, but the thing that would keep us out of heaven is mortal sin, not having an insufficient number of good works.
Scrupulosity is "a disordered fear that one is sinning or is in danger of going to hell." Ultimately, it marks a lack of trust in God’s mercy, but I think scrupulosity tends to be involuntary — like obsessive-compulsive disorder, which Jimmy alludes to in his post.
It’s the sort of problem that might actually be helped by therapy — except that you had better choose your therapists carefully, lest they try to rid you of your "guilt complex" by eliminating every honest impulse toward repentance. The point is balance and perspective: Neither scrupulosity, nor presumption.