Well again that lacks biblical support. Some people need opiods to help them with pain that does not mean they should use it every day to get their fix in.
and yet it doesn't mean they should suffer needlessly if the medication is truly to relieve their pain. God made the opium poppy for a reason.
Often times, sin is about what's going through your mind more than a physical act, depending on whether that physical act itself is causing harm or not. That's part of why we're guided by the Holy Spirit rather than being legalists. We're to use judgement and discernment from situation to situation because the law by itself doesn't discern and can end up causing more harm than good if followed to the letter while missing the spirit of the law in its practice.
If you're abusing a drug to get high, that's most certainly sin. If you're using the same drug in smaller doses to alleviate physical pain connected to a medical issue, that's not sin.
If you're masturbating to porn while fantasizing about having sex with the woman on the screen or magazine page or your imagination of a real woman you know that might be someone else's wife, where's your heart at? It's in lust and fornication and maybe even adultery.
If you are masturbating while thinking of your wife because you love her and miss her (the deployed soldier scenario) and want to be spending time together with her, even sexually, and are thinking about joy with her, is that sin?
If you're simply taking care of a biological need to get rid of old sperm to not have wet dreams, and aren't using porn or lusting about someone to do it.. where's your heart, it's not in lust or adultery or fornication. So I wouldn't see the sin in the physical act itself.
Mind you I'm not defending pornography, that in itself causes harm, stirs lust, and just compounds sins on top of other sins.
But I think with the absence of any mentions of the physical act of masturbation itself.. that the physical act is not sin, and that we should use discernment and judge where our heart is.