Typical distractions or distractions of any sort do not invalidate the sacrament, if proper matter and form are used then the *only* thing that invalidates the sacrament is for the priest to say those above words in his heart, which we can never know unless the priest were to publicly confess such a thing after the fact.
No, a lack of intention also invalidates, the same as a contrary intention. But a habitual intention to do what the Church does suffices. So, for instance, a priest does not have to think during each Mass, "I intend to consecrate. I intend to consecrate." But the priest who just offers Mass without explicitly forming the intention nevertheless has a habitual/virtual intention to do what the Church does. He wouldn't be going out there each day to offer Mass except that he's intending to do this Mass that the Church does.
No, nobody has to say any specific words in his heart, nor any words or explicit thoughts for that matter. That's a total misreading of it. All it means is that if someone has a contrary internal intention against DOing what the Church DOES, then it would invalidate the Sacrament. It doesn't have to be "words" in one's heart of any kind, but that's just an example to illustrate the concept.
What's lost on the brain of "De Lugo" is that it's about intending to DO what the Church DOES, and not intending what the Church INTENDS.
You needn't intend what the Church intends but simply to do what the Church does. This is why an atheist can baptize, as all theologians hold. He simply intends to perform the rite. He could be thinking the entire time that it's a bunch of nonsense and has no intention of putting the "soul" (that he doesn't even believe him) into a state of grace or having their sins forgiven and receiving the Sacramental character. He doesn't have to intend any of what the Church intends by the Sacrament. He just has to intend to DO what the Church DOES, i.e. "I intend to do this thing that Catholics/Christians do." That's it, and this suffices for validity.
Same thing holds of the Masonic +Lienart. Like the atheist in the above example, if he puts on his vestments and performs the Rite of the Catholic Church to ordain a priest, he intends to DO what the Church DOES, whether he believes in a priesthood or not, whether he intends that the man should become a priest or not ... or whether he has a positive CONTRARY intention.
Similarly, we say that bread is required for valid Mass / consecration. It doesn't matter if there's simply NO bread or if someone tries to use a fudge brownie. Similarly, it doesn't matter whether the intention is missing or if there's a contrary intention. It's invalid either way. Something is just as invalid by mere absence of a requirement as if someone tried to substitute a contrary element.
+Lienart could sit there gritting his teeth repeating to himself over and over again, "I don't intend for this man to become a priest. I don't intend for this man to become a priest." but it matters nothing. +Lienart would have been intending to perform the Catholic Rite of Ordination, just as that atheist baptizing, and it would be valid on that account.
Scenarios where the internal intention do DO what the Church does would be lacking include things like ...
1) minister not of sound mind (insane, half asleep, etc.)
2) minister just playing (young Athanasius story) ... where they're not intending to actually DO what the Church does but just to imitate it in play
3) minister doing it to mock the Sacrament (two atheists fooling around and mocking the Sacrament while pouring water on each other and saying the words)
But eterior mocking doesn't necessarily invalidate either. You could have that aforementioned atheist performing the Baptism, making faces and comments and eye rolls the entire time, or even preface it with, "What a bunch of nonsense, but here goes ... I baptize you, etc. ..."
Not intending the Saramental effect, however, does not invalidate the Sacrament.
This is very clear. So often various individuals pounce on what they assume to be the true meaning of something without actually understanding it.