To help yourself with the emotional and spiritual pain, I recommend that you use the medicine of the rose: http://gnosticteachings.org/books-by-samael-aun-weor/esoteric-medicine-and-practical-magic/190-the-magic-of-the-roses.html
When we make mistakes, it is hard to retain faith in ourselves, and find hope when we are in pain. Nevertheless, those painful times are critical moments in which we can truly change. Let the pain and remorse guide you to find what you need to change in yourself. Reflect on how you created those painful circumstances: find the behaviors, desires, patterns, etc in yourself that caused the results you are experiencing, and then resolve to change them. This is the essence of Gnosis. For this, you must meditate every day, and appeal to your Innermost for aid. Moreover, you must truly understand that the pain you feel is a consequence of actions you performed. By comprehending that, you then come to truly understand how to not repeat those mistakes. It is easy to avoid pain, or try to cover it up, but that only means that we also avoid what caused it, and by avoiding what caused it, we do not change the cause. This means that it is inevitable that we will repeat the mistake: it is only a matter of time. So: do not fall into that trap.
All of us instructors know people who have committed truly unimaginable, terrible mistakes and have suffered terrible consequences, yet in spite of all that manage to resolve to change and become better people. And they do it. If they can do it, if we can do it, so can you.
Remember, no matter how terrible our crimes and mistakes, at least one door always remains open to us: repentance.
Finally, do not be afraid of the number 13. That number is very powerful, since it always brings very significant change. Read this: http://gnosticteachings.org/courses/twenty-two-arcana-of-tarot/512-arcanum-13-transcription.html
Without the 13, no one can become Self-realized.