Info from other posters that I'm passing on - it's a longish walk or a short taxi ride from the Pompei station to the Scavi "back" entrance. Consider that you'll be walking for hours in the heat at the sight.
It's not worth changing hotels to spend a night in Naples and it will take about as long to get to Pompeii from there anyway unless you stay in the not-very-pleasant-though-perfectly-safe area near the train station. In Salerno, the old town is an easy 10-15 minute level walk to the train station. You could take the train from Salerno to Naples, store your bags at the station and take the metro to the museum, then take the train to Rome. The problem with doing that or going to Pompeii and the museum in one day is determining in advance how much time you want/need at each sight. Some people find 2-3 hours at Pompeii to be plenty, others spend most of a day. The museum can be a 1.5 hour or a 4.5 hour visit, depending on your interest. It occurs to me as I write this that if you choose to stop at the museum on the way to Rome and you find a couple hours at the museum is all you want, that would leave you 2-3 hours to have a leisurely lunch or do part of the RS Naples city walk that starts across the street from the museum.
I believe the archeology museum in Paestum is closed on Mondays. Make sure to go when it's open. I drove, but according to my research, the bus is better than the train because it gets closer to the temple site. The temple ruins are best around sunset but that may not be feasible in July.