I have done a Snowdonia race travelling down on the morning.... although it was New Years Day so the roads were totally empty and i got there well under three hours. Although its not ideal.
Any race i was taking seriously i always stay the night before, and usually for the night after too.
Most races of that ilk are based around Llanberis (that Xterra one is a typical example). Right in the heart of Snowdonia, at the foot of Snowdon, a lovely place. There is plenty of typical accommodation in Llanberis (Hotels, traditional b&b's), although usually booked up well in advance as its basically "the hub" for everyone who goes up and down Snowdon.
I tend to use booking.com or airbnb, got a place in Llanberis for my last race. But you would be absolutely fine staying in Betws-Y-Coed (plenty of accommodation and pubs/food, 30mins drive from Llanberis), or Capel Curig (limited accomm, food, drinks, midway between Llanberis & Betwys).
Bedgelert another similar place and only 30mins drive.
If i can't get a place in Llanberis, i usually stay on the north coast, typically in Llandudno, sometimes Conwy.... they are only 45mins away, and have all facilities. Llandudno on a nice day is (in my opinion) as good as it gets for a UK coastal resort town.... with the Great Orme and the road around it, it is gorgeous.
There's other options.... Carnearfon, Bangor, even the nearest part of Anglesey.... but i personally prefer Llanberis or Llandudno.