You are coming down from Glasgow - it would really make sense to see NW Wales rather than SW Wales. I would pre-book an Advance ticket with www.virgintrains.co.uk from Glasgow Central to Conway (CNW). These can be had for as little as £35.50 and the journey will take 4 hours 48 minutes. However, you may wish to visit the City of Chester as you will be tasing through. That being so, buy an Advanced ticket from Glasgow to Chester - which can be had for as little as £16.50 if pre booked about 11 weeks ahead. (You will need to change trains once). This journey will take 3 hours 11 minutes. You could then have lunch and a walk around Chester before catching a train to Conwy (Conway) and paying £21 on the day for this 1 hour trip. www.nationalrail.co.uk for trains.
So, you could see Conway Castle and spend a night or 2 in the town. (2 if you want to see Bodnant Gardens and Llandudno). You could Llandudno Junction on the 10.28 or 13.30 train (current schedules) for Blaenau Ffestiniog (1 hour) where you transfer to the narrow gauge steam railway to Porthmadog on the coast.. (Check schedules match at BF - the usually do. See www.festrail.co.uk).
Check into a hotel in Porthmadog - or even Portmeirion if wealthy (Minfforrdd station and arrange a pick up). Stay 2 or 3 nights in Porthmadog. On one of days - visit Portmeirion and on the other take the Welsh Highland Railway to Caernarfon. (see Festrail).
You could leave Porthmadog by train for Cardiff via the slow but scenic Cambrian Line. Change at Shrewsbury (worth an hour or so) for a faster train down to Cardiff for the remaining time you have in Wales. A couple of companies offer mini bus tours out of Cardiff should you not wish to use public transport. St.Fagans Castle & Museum is easy to reach by Easyway bus 32A from Westgate Street. Caerphilly Castle is easy to reach by train.
If you really wish to go to Pembrokeshire, I suggest you head for Tenby. Get as far as Aberystwyth = Vale of Rheidol Steam Railway well worth a trip. Bus from Aberystwyth to Carmarthen and then train to Tenby. (You might like to break the journey for an hour
or so at the attractive harbour town of Aberaeron). Aberystwyth to Tenby takes 4 hours.
If you do not wish to go to south Wales, take the train directly back to London from north / mid Wales. If you go to Tenby, it is possible to go by train to London but it takes around 3 hours to reach Cardiff and it is 2 hours from Cardiff to London. (The change of train is usually in Swansea).