Originally Posted by Zanriel
Maybe it's more about letting go of guilt and shame and just feeling free to be yourself and live life. I know that helps a lot. In fact, in my experience, the number one biggest defense against any type of negativity (whether you want to call it demonic or not) is releasing guilt, resentment, and regret. Forgive yourself, forgive others, and drop the chatter in your head that tells you you're bad, you're wrong, etc. Eject it like a bad tape and replace it with thoughts, feelings, and actions that make you feel good about yourself. The practice you mention, when done with self-love and good intentions, is a powerful way to do just that.
Well, I don't know.
If we are allowed not to be scientific, I got another theory: Sleep Paralysis comes from an active and incorrectly controlled paranormal perception / "psychicness" . When you go to sleep and got predisposition for those things without knowing, you might reach some elevated state in sleep and some of the dudes that love energy will stick . Masturbation is a very earthly thing it "grounds" you into the material world before going to sleep, thus reducing your connection to the spiritual side.
On a less paranormal view of things, I also noticed that if you change your sleep position, it helps.