you might make it!
Ciao Comanche23,
You can definitely buy tickets there directly. You can see costs on the official site here
http://www.mugellocircuit.it/it/gran-premio/prezzo-biglietti.html
The moto GP race starts at 2pm (see program here
http://www.mugellocircuit.it/images/stories/motogp/TimeSchedule.pdf )
so personally, whether you drive or not, I think it would be cutting it too close to be back on time at the ship.
The drive from Livorno to Scarperia is about 1.30hr to 2hr, all depending on traffic in Mugello once you leave the A1 (see map
http://goo.gl/maps/30Jtx ). The region has gotten much better at managing flow of cars along the roads and has instituted ways to get to and from the race track for that day, so you have to follow signs once you're in the area.
So if you drive there, I would give it 2 hours.... so will you see the race and leave on time to be back by 6pm?? Not sure!! There are definitely parking lots near Scarperia where you park and then walk the rest of the way, that isn't the problem.
Solution: go as early as you can make it, enjoy the warm ups and first races and eventually just give yourself a time by which you have to leave to make it back to the ship on time! Like leave by 3.30pm, regardless of what point the race is at. Seeing the schedule, I think it might just be over by then but you really have to then try to beat everyone else at leaving.... in this case, I recommend going directly with your own car.
But also consider that if you leave a little before the race is over, you won't have problems with the crowds leaving the track or traffic as they are all still there!
Whatever you decide to do, let us know how the adventure turns out ok?