Don't masturbate if you're gonna have sex. You wanna be as horny as possible when that happens. Also it could make your balls hurt more and interfere with the sex. As you are right now having sex would make you completely forget about the ball pain.
ALSO it could be swelling from overuse if you fap more than once a day. I really wore my balls out a year ago from fapping 3x a day and was in a lot of pain.