Does the 3 weeks after the Cotswold walk include time to be spent in Ireland?
Look at this rail route map. The most obvious route to me would be to go from MIM by direct train to Hereford where you can change for another direct train that will take you to Conwy/ Llandudno Junction. Now, you will notice that leg 1 of this goes through Worcester so it sounds like you will be stopping off at that small city. (I was not impressed by Worcester on the one time I visited).
Hereford is the next small city that you would come to and have to change trains. Like Worcester, Hereford has a cathedral and some old buildings. Not sure that I would want to make it more than a pit stop though it does have buses going W to Hay-on-Wye and Brecon. Trains also take about an hour to reach Cardiff - the Welsh capital.
Proceeding north from Hereford on The Marches Line, you will now be on Transport for Wales Trains. Ludlow is an historic town with a castle - best viewed from across the river on the west side. Ludlow is certainly worth a look but not sure that I would want to stay more than a night.
Shrewsbury is the next town going north and has a number of historic buildings and several train lines converge on the town. One of these is the Cambrian line going west to the coast and this line is very scenic. The first stop W of Shrewsbury is Welshpool where you will find Powis Castle - which is a bit of a trek from the station. So, staying over in Shrewsbury, you could consider that as a day trip.
You could consider going west on the Cambrian line all the way to the west coast and maybe stay in Barmouth or Porthmadog. Of those 2, Porthmadog is the better placed for travel into the Snowdonia National Park but I would not rave about the town.
The other alternative is to go N from Shrewsbury for a stay in Chester from where you could do a day trip to Liverpool. Chester is well worth seeing.
Finally, Conwy: small and attractive with a big medieval castle but also a stones throw from the lovely Victorian seaside town of Llandudno. Day trip possible from either to Bodnant Gardens - highly recommended. You could also take the Conwy valley line to Betws-Y-Coed or even the old slate mining town of Blaenau Ffestiniog from where a narrow gauge steam railway goes to Porthmadog. www.festrail.co.uk
https://www.visitwales.com = Welsh Government tourism site.