First of all, I will keep you in my prayers as you deal with this sin. It is a very hard habit to break, especially since you have been in the habit for so many years. I read something once from St. Jean Vianney (aka Cure D’Ars) about the very thing you are going through with dealing with temptation while waiting for confession. He said that suppose you had a husband that was abusive to his wife. He knew what he did was wrong but would often lose his temper and hit her. Now, if he once again abused his wife and while waiting for confession kept engaging in hitting his wife figuring “what does it matter, I have to go to confession anyways and am in the state of sin”, who in there right minds would think it’s ok for him to keep hurting his wife just because he’s already in the state of mortal sin and doesn’t have to control himself???
I know you realize that sinning mulitple times inbetween confessions is a sin, but this is a story that I always thought was helpful to me, as I once struggled with the very thing you are going through. I thought that it doesn’t hurt anything if I kept sinning while I waited for confession, but this story helped me to realize that ALL sin is harmful to either YOURSELF or someone else. And, indirectly, all sin is harmful to everyone, no matter what the sin.
The best way to avoid this type of sin is to keep busy…don’t let your mind be idle! An idle mind is the devil’s playground so keep yourself busy with things, preferebly holy things. Read a book, play a game, pray, etc, etc, etc. Don’t give those unholy thoughts time to dwell and tempt. I found that when I read holy books, either about saint’s lives or anything catholic in general, really helped me to stop sinning. My mind was constantly on things of holier topics and kept my mind thinking of better things, not things of the flesh. And keep praying! Pray the rosary EVERY DAY! Mary will help you get past this sin…even when prayer doesn’t seem to help, it does help! I will pray for you as well as I once walked in your shoes. Good luck and God bless!!!