As alanR has said, the 747 bus to Inverkeithing is probably your way out. It heads in the right direction and avoids having to head back into the city. If there are two of you a taxi might be a worthwhile option. The trains are pretty frequent and your main timings uncertainty will be clearing luggage customs and immigration checks.
If you are over 55, there is a worthwhile saving on trains within Scotland called "Club 55", no nationality restrictions but some train operator restrictions. Although this offer is only for this month they keep repeating them so it might be worth checking back:
http://www.scotrail.co.uk/club-55
I am off to work in Edinburgh tomorrow from just south of Aberdeen and taking a return for £19, so cheaper than the fuel, and the travel times are better than driving and parking!