These are cities with a substantial number of sights. I'd dig into what's available in each and see what makes sense. If you determine you have only one day's worth of sightseeing in Glasgow, I'd treat it as a day trip from Edinburgh.
In my view it's not the best idea to make multiple day trips to the same city. It's not just the time on a train (admittedly, not terribly long); you'll also have to allow time to get between your hotel and the train station in the base city every time you do that side trip, and then you'll need to travel between the destination train station and the first/last sight in the city you're day tripping to each day. I assume there are flights to Dublin from both Edinburgh and Glasgow, so you'd really need to travel between them only once if you set up two bases.
Full disclosure: I liked the cities equally; most people devote more time to Edinburgh (which makes it much, much more touristy).