It's a complicated mess, isn't it?
I've been looking at a similar - or apparently so - trip in a couple of weeks. From Reading to Biggar, which is in the railway desert south of Motherwell. While Carstairs looks an obvious railhead, it's no use coming up from Carsisle - no trains stop.
Even Motherwell is pretty frustrating as far as that's concerned with lots of journey options involving a trip via Glasgow and an express passage through Motherwell the best part of an hour earlier / later. I suppose the ultimate frustration would be if the express got stopped by signals in the station ...
So the journey has to be completed by bus and, as there's a direct bus from Edinburgh, that works better than Glasgow (or Motherwell/Lanark/Carstairs).
Have you looked at bus 102 from Dumfries to Biggar? https://bustimes.org.uk/services/EDAO102
Melksham, by comparison with Reading, has no super off-peak and worse restrictions on its off-peak, as well as costing more.
But it does have "not via London" with off peak valid from 04:15 for very long distance journeys ...
All this peering at restriction codes has shown up a puzzle - that familiar issue about returning across London in the evening.
That doesn't mention the return from London to (e.g.) Reading. As I say, I don't believe it is what defines the restrictions - just odd that it's missing. Journey Planner knows that leg is not subject to the evening block on off-peak travel on fast trains.
Just beware that this stuff's pretty complicated and I have seen reports of Journey planner
knowing better than some rail staff - so I suggest you carry a few printouts, a bunch of patience, a posey of politeness and your best smile.