Occasional spotting after sex, especially when it lines up with dryness or less lubrication, is usually from a minor cause like vaginal irritation or cervical ectropion, not cancer. Cervical cancer related bleeding is far less common at your age and usually doesn't stop and restart the way yours did. Your pap smear is exactly the right test to confirm things are fine.
Next Steps
Mention this spotting history to your gynaecologist once your pap result is in, so they can decide if a closer look at the cervix is needed. Using a lubricant during intercourse can help if dryness is the cause.
Health Tips
See your gynaecologist promptly if the bleeding returns, becomes heavier, or happens outside intercourse too.