This is the the wrong time of year for this post, but I thought about it anyway so stop judging me already!
Sin [or immoral or unethical behavior or the opposite of Right Action or whatever you want to call it] is subtle. You can do something that isn’t sinful, but if done with that kind of evil intent, would probably still qualify. [These thoughts mayn’t be canonical, I dunno.] So if there is an orchard of apple trees and you sneak in and grab a couple to eat and sneak out and eat them, with the idea that if you get caught you’ll get in trouble [even if the lady who owns to orchard really doesn’t mind if people come take her apples] then you’re sinning.
Sinful thoughts are hard to avoid, but as long as they don’t inspire internal revelry or external action, then they aren’t really sin. But one can also do no harm although they intend to do so and I would consider that a sin. There is also doing something with evil intent that has a positive [though unintended] resolution. The unintended part is crucial because otherwise you fall into the “a wrong doesn’t make a right” situation. The easiest example of evil intent with unexpected positive resolution that comes to mind is at the end of The Return of the King, when Gollum’s lust for the ring results in its destruction. I think that’s probably still a sin, because it appears my definition of sinfulness is predicated on what my momma taught me, willful disobedience is always a personal feeling of selfishness. What about not knowing you are doing wrong, but do wrong? I think that only becomes a sin when the ignorance is rectified and behavior is not changed, nor restitution sought. I think that covers it.