There is a story written but one of the exorcists, Fr. Amorth if I recall correctly, that details a perplexing case of a person who was a spiritual child of Padre Pio and lived a holy life. When he entered an older age he became possessed, he did nothing to open the door for it. After he was liberated the exorcist felt that the suffering was a way for him to be spiritually purified so the man could enter into heaven when he died.
Again, the tricky bit here is that we are talking about heavenly vs. diabolical and how much each is allowed to effect us and not cause and effect.
State’s of Grace are by God’s permission. In fact all demonic activity (curses, afflictions (like those of saints), possessions, etc.) are allowed by God. While the demonic have been described by various people (Padre Pio, Scott Hahn) as being on a leash (they cannot do whatever they want), we do not fully understand what limits are put into place by God.
The risk is oversimplifying what a State of Grace is and looking at it like cause and effect. I do this action and thus I am safe, rather then I do my best to follow God and trust in his will and protection. If one follows the oversimplified version then in a case stated above or as the poster requested, it would appear that the State of Grace is “broken” rather than understanding that God permitted a form of demonic activity for a reason.
Granted, while I agree that being in a State of Grace is the best way to protect oneself, I cannot say with any certainty that God may not decide to allow one to suffer a demonic affliction for a reason that fits into God’s plan. One has to remember that curses (the way we think of it as a form of magic or something we have control over) are not what is occurring, it is another example of diabolical activity. Diabolically activity in general when looked at as a whole has not been relegated to those only suffering states of mortal sin.
Again, this is a question better suited for an exorcist rather then myself.
God Bless