lots of places by train, Linlithgow is a lovely place ( Mary queen of Scots was born there) and only about 20 minutes by train,North Berwick a lovely seaside town is about 50 minutes away.You could take a train and cross the Forth Bridge an amazing piece of Victorian engineering , you will also be able to see the Forth road Bridge and the new Queensferry crossing that is nearing completion ,so a train to North Queensferry or anywhere in Fife is a good idea, Dunfermline is nice but it is a bit of an uphill walk to the main town from the train station.
Then you have the recently opened borders railway, last stop is Tweedbank and from there you can visit Abbotsford house the home of Sir Walter Scott, about a 15 minute walk from the station, the town of Galashiels is the stop before Tweedbank and is a very nice little town.
Stirling is an hour away Glasgow about 45 minutes and Dundee a bit more than an hour, so as you can see loads of options.