That’s a difficult distance to do around there as easy to do a shorter or longer loop. Using the train opens up a lot of options though.
Would recommend any of these:
1) Get the train to Corrour Halt and ride back via Loch Trieg, Ciaran path, Blackwater Dam, the awesome path on the N side of River Leven then WHW through Lairig Mor to Fort William.
2) Train to Corrour, then ride back via Loch Treig, Allt na Lairig to Lairig Leacach Bothy (a fair section from Loch to Bothy will be a push unless it is VERY dry), drop down Landrover track to junction at GR253793, use bridge at 238784 then follow track up W side of burn to reconnect with tramway at 230768 (the tramway between the path to the bothy to this point is not worth the bother, missing bridges etc so not worth attempting) and follow this W until you’re virtually under the Gondola – you can then pick up bits of Witches Trail to take you out at the North Face car park (at 148770) and pick up the cycleway they built for the World Cup. Pay respects to Jason McIntyre as you pass the Roads Depot, then back into Fort William via Great Glen Way along the shore. This probably works better in reverse from a pure riding point of view, but doing it as I have suggested avoids the stress of needing to be at Corrour by a given time to get a particular train!
3) Get train to Bridge of Orchy and ride back along WHW over Rannoch Moor, Devil’s Staircase, Kinlochleven and Lairig Mor.
4) Start in Fort William, follow (2) in reverse then from Lairig Leacach Bothy head for Luibielt, down the side of Loch Eilides Mor and Beag, then stay high past Mamore Lodge hotel to pick up the WHW back to Fort William. Don’t ever be tempted to cut down to Glen Nevis from Luibielt, there lies MADNESS.
They are all good days, would recommend any of them, though definitely full days out. (1) is the most Tech followed by (4). Not sure on distance but probably most nearer 40 miles than 30, all offroad though all have quite a lot of landrover track so are reasonably quick riding for a lot of them.