One of my favorite places to hike is out of Dunkeld. You can easily take the train there and spend the day hiking in the hills. Here's the list from WalkHighlands. And here are a couple more websites here and here.
Walk Highlands shows the range of walks. I've walked along the Tay, and done the Hermitage Walk. I've also just hiked up into the hills a bit. You can pick up some trail maps at the TI in Dunkeld. It is close to two hours to Dunkeld, but in my mind it is so worth it. Oddly, I'm only seeing a 6:30 AM train, which just seems wrong as it's the main route north to Inverness and so there should be a train that leaves at the sane hour between 7 and 9. I must be entering something funky in my search. And BTW you need to check carefully on any trains between Edinburgh and Glasgow as they are working on a tunnel which means you get put on busses and it's not as fast.
Also, while I've not done any walks in this area, I know it's popular with locals and that area is the Pentland Hills. I am pretty sure that they have featured in an Ian Rankin book. :) You might want to just explore Walk Highlands a bit. I've also found, as you can see from the Perthshire links, that going to town websites and searching on outdoor activities will bring up suggestions. I searched on Stirling and walks, and avoiding the links to Walk Highlands I found this page. You can see that it has some references to public transit, which can really help. If you find one that looks interesting, you should think about posting on the TA forum for town. That will get you some local feedback pretty quickly about the reality of doing it via public transportation.