Having sexual urge at this age is very normal. Your muscle spasm has nothing to do with your manliness and not all male will have it in condition like yours. Most probably it must be a result of stress generated over your sexual suppression (suppressing physiological arousal).
If you want to avoid intercourse before marriage, you can do either of this, ask her to help you in masturbation or masturbate on your own fantasizing about her.
Migraine is known to occure in such kind of stressful conditions.