Since the Kelvin was there before Nero's incursion, what was it doing in the prime universe?
It wasn't in the Prime universe.
Nero's ship arrived in that alternate (or real universe, depending on one's viewpoint) to capture Spock Prime before he arrived. Hence, waiting 20 years because they--Nero and his crew--arrived too early...
The ship existed in the prime universe. The timelines didn't diverge until Nero's ship popped out of that black hole, and the Kelvin was there. Even
www.memory-alpha.org considers the Kelvin as a Prime Universe vessel.
As for what it was doing, probably exploratory missions. I've read theories here that Starfleet could have detected the anomaly and then dispatched the Kelvin to investigate, too.