You can take the train from Porthmadog to within a mile of Portmerion. It's on the Blaenau Ffestiniog Railway. Another worthwhile trip is on the Welsh Highland Railway from Porthmadog to Caernarfon. The line follows the Glaslyn river as it climbs into Snowdonia; it is really stunning scenery.
If you're in the area you can always drive to Morfa Nefyn and take the 2 km walk to Porthdinllaen and have a drink at the Ty Coch pub. It's rated as one of the most spectacular places with a bar on the beach.