I think the confusion comes from the way you are looking at sin, like it's some kind of poison that stays in the system for a while, tainting things that happen while you're still under it's effect.
Rather, look at sin this way, it's disobedience against God, and it makes Him upset when you engage in it. Jesus died to take away any enslavement you have to sin. It's not your master, but you have the worst of all possible 'bad habits'. Like any other bad habit, keep feeding it, and it will enslave you again. Resist it, and you will overcome it. Resist it, and ask forgiveness when you do fail. Resist it yet again, don't take God's grace for granted and have a cavalier "I'll just do as I please because God will forgive me" attitude. But, on the other hand, don't think God's grace is so fragile a thing that falling into bad habit is enough to cause you never to be forgiven again.
Also, what is blasphemy of the Holy Spirit. This is truly the only unforgiveable sin. Every other sin against the Father or the Son will be forgiven, but not blasphemy of the Holy Spirit. What is it? It's when one knows something is truly of the Spirit, such as the Pharisee's understanding that the works and miracles of Christ could only be by the Spirit, and yet one ascribes those works to Satan, or to science or to man, especially so that one can remain in a power position, then that is blasphemy of the Spirit. The Pharisees engaged in this: They knew that Jesus was the Messiah, they knew the signs, they knew the miracles could only come from God, and yet, in order to retain thier power position over the people, they tried to convince everyone else that Jesus was doing what He was doing by the power of Satan. See Matthew 12:25-32
I know that some have defined blasphemy of the Holy Spirit as the final rejection of Christ's saving grace for themselves, but I really don't see that interpretation in Scripture.
I hope that this answers your question, because in all honesty, I had a tough time understanding it.
BTW, I'm not even addressing whether or not masturbation is a sin. While there might be some here that think it isn't and some who are convinced it is, it really doesn't matter, Because as long as GI thinks it's sin, for him it is.