Dear Gareth,
I've not read all of the responses in this thread, yet your post immediately captured my attention. I can barely contain myself as I type this response, yet I have battled an almost identical trangression, although my blasphemous thoughts toward the Lord are predominantly not sexual in nature (although some of them are). Believe me, they are even worse than what you are describing here. Please know that you are not alone!
This is the first occasion I have ever read of anyone going through something similar! This very transgression drove me from the Lord almost ten years ago, caused me to become suicidal, engendered a constant fear within me that I would commit the unpardonable sin, paralyzed my entire existence for years. In my panic and torment I could not discover a solution, I was so disheartened that I gave up and did all I could to flee from the Lord just to drive the maddening thoughts away. A few months ago I recommitted my life to Jesus and I yet continue to struggle with it on a daily basis. Nevertheless, instead of attempting to suppress the thoughts that enter my mind as I used to, I counterattack them with Scripture. Attempting to suppress a thought merely reinforces your focus upon it--it will never, ever work. I know this, I have been going through this for a long while. Although I still struggle a great deal and I am depressed much of the time, I have noticed that there is a decrease in the frequency of the thoughts. Sanctification is a process!
I urge you to memorize Scripture--the more, the better. I recite 1 Corinthians 10:13 a lot, as well as other Scriptures to bring down any lie Satan or my flesh is introducing. God asks us to daily renew our minds and as difficult as this may be, He would never ask us to do the impossible. What we cannot do for ourselves He has already done for us, and through the help of His Holy Spirit we can overcome the sins that cripple us and steal our joy.
I also recommend that you be very diligent with your heart. Meaning, take great care what you expose yourself to (ie the type of programs you watch, the music you listen to) and the activities you engage in. It is difficult enough to remain sexually pure without exposing ourselves to the garbage that can be found in the world.
Please feel free to PM me whenever you need support or a friend to listen. If for a moment you entertain the thought, please don't give up on your relationship with the Lord because of this. I did for a season and it was the worst error I committed: it solved absolutely nothing. Yet through His unbelievable grace and mercy, He drew me back in. He is the only one who can cleanse and liberate us--we need to cling to Him no matter what the cost! He loves us and wants us to be holy infinitely more than we do. He would not draw us to Himself and then leave us without resources to live the life He desires us to. He wishes for us only the best!
God bless you for having a pliant, sensitive heart before Him that desires to live life according to His will. Hang in there, sweetheart! The Lord is good and His thoughts toward you are excellent and innumerable!
(I apologize for the frenzied lack of eloquence--I discard grammatical sense when I am emotional!) *Smile*