I have greatly sinned,
in my thoughts and in my words,
in what I have done and in what I have failed to do,
I think it also pertains to the thought in particular.
For example, I’d agree that thinking about screaming at your mother would be sinful. But not because you were thinking about doing something sinful, but because thinking that means you already had hatred towards your mother.
And with theft for example, thinking about stealing someone’s gold necklace even if you don’t intend to may be sinful due to envy, not thinking about theft.
And thinking evil thoughts towards God would again be something where thought could be sin.
But let’s take another situation. A man’s sitting a chair when they realize they need to get something from across the room. Not wanting to get up they wish they could just use magic to levitate it over to them before getting up to get the item. They thought about using magic and delighted in the thought. Magic is grave matter. Is that mortal?
Or the store employee who after a hectic day sees the store is a mess. Dreading how long it’ll take to clean the thought of just burning down the store pops up. This is followed by a mental image of laughing as it burns which amuses them so they give a chuckle before cleaning up the store. They found the idea of arson amusing so did they sin?
Or the secret service agent who looks at a location and starts thinking of way someone could try killing the president, granted so that they prevent those attempts. One cannot commit evil with the intent of doing good so if thinking about how to kill an innocent (in this case the president) is a sinful act, doesn’t that mean the agent has mortally sinned in doing that if all willed thoughts concerning grave matter are mortal?
So this is why a thought about a sinful thing, even if willed, may not be a sin and why this forum isn’t a great place to ask about this. A priest, with more theological education than most posters here, is a much better person to ask about this.