In all honesty, I don't feel qualified to address the subject of masturbation as sin. I think that Jesus was pretty clear about lust being a sin and it being a commandment violation. However, I would point out that sexual attraction is not the same as lust. Sexual attraction is part of our nature, we are supposed to be attracted by our mate - that's how God made us. Lust is the perversion of that attraction that covets what is not ours and desires to use people for our own purposes without the protection of the loving covenant of marriage which God has given to us. But only you really know your situation, I don't want to tell you that you are not sinning. I am just throwing out some cautionary thoughts there.
Like I said, I don't feel qualified to really deal with masturbation as sin, but I did want to address a specific part of your post. I think that some encouragement is in order. The way you describe your struggle is something that only a Christian who is seeking to honor God can understand. The unbeliever cannot share in the same struggle, because they reject God's rule over their lives. They don't battle against their flesh with a renewed mind - your struggle is a sign of the Holy Spirit at work in your heart.
You are in good company - I'm sure you will find the words of the Apostle Paul very familiar:
"For we know that the law is spiritual, but I am of the flesh, sold under sin. For I do not understand my own actions. For I do not do what I want, but I do the very thing I hate. Now if I do what I do not want, I agree with the law, that it is good. So now it is no longer I who do it, but sin that dwells within me. For I know what nothing good dwells in me, that is, in my flesh. For I have the desire to do what is right, but not the ability to carry it out. For I do not do the good I want, but the evil I do not want is what I keep on doing. Now if I do what I do not want, it is no longer I who do it, but sin that dwells within me. So I find it to be a law that when I want to do right, evil lies close at hand. For I delight in the law of God, in my inner being, but I see in my members another law waging war against the law of my mind and making me captive to the law of sin that dwells in my members. Wretched man that I am! Who will deliver me from this body of death? Thanks be to God through Jesus Christ our Lord! So then, I myself serve the law of God with my mind, but with my flesh I serve the law of sin." (Rom. 7:14-25)
The apostle Paul struggled with indwelling sin that discouraged him - but what was the answer to his despair? He says "Thanks be to God through Jesus Christ our Lord!" Why does he say this? The very next verse tells us why:
"There is therefore now no condemnation for those who are in Christ Jesus. For the law of the Spirit of life has set you free in Christ Jesus from the law of sin and death." (Rom. 8:1-2)
Despite your sin, and your struggle (which is a sign of true conversion), there is no condemnation awaiting you because you are in Christ who has taken that sin upon himself. It is crucial to continue to get encouragement in this gospel promise because if you don't take that to heart, then you will neglect God's means of grace. You will neglect prayer and Bible study, but most importantly you will feel unworthy of assembling with God's people for worship. This is the most pernicious threat of all because it is in that covenant assembly where you will be equipped and strengthened to serve God. It is there that you will be fed on the word preached and the word made visible (the Lord's Supper). You must continue to avail yourself of those good gifts which God has given to us weak and needy sinners.
Another thing - don't mistake your weakness for unrepentance. You sound like you are a repentant sinner, which is the only requirement for being part of the body of Christ and for partaking of his Supper. If you were unrepentant, then you would be trying to justify your sin, but as it is you are merely having difficulty consistently carrying out your repentance. But you know what? We are all in the same boat! None of us carry through with our repentance the way we should, that's because we're sinners! Also, the NT term for repentance is metanoia and it first means a change of mind, not a change of behavior. This means that you agree with God that a certain thing is sinful (if it is something that He declares to be sinful), the action is secondary and is a response. You can really understand Paul's statements in Rom. 7 when you take that into account, he agrees with the law that he is sinful but he seems to keep on doing the very thing he hates.
Finally, do not become overly introspective. It is good that you are examining your life, and you should continue to do that, but don't make that your primary focus. Remember that your only assurance is found in Christ, it is found in his objective work on your behalf. Navel-gazing will only lead us into despair because we will never measure up to God's law. None of us can look to God's law and find assurance in our own performance. Look to Christ, the author and finisher of your faith.