Treat the two cities as two temperaments. San Miguel is the polished register: an art-and-food scene woven through with long-stay foreigners, rooftop bars aimed at the Parroquia's spires, hot springs a short ride out, and a pace set by the evening paseo. Guanajuato is the rawer register: a university city poured into a ravine, all subterranean streets, funicular views, alleyway music walks and a young crowd. Neither is the other's day trip — an hour-plus of road each way amputates exactly the dusk hours both cities exist for.
So split the stay, and let each city run its own rhythm. San Miguel's days are galleries, courtyards and the springs; its evenings belong to the rooftops. Guanajuato's days are museums and miradores; its evenings belong to the callejoneadas, the singing processions through the lanes. Altitude binds them: at this elevation the days are mild, the sun is strong and the evenings turn cool — the rooftop hour is the hinge of every day, and itineraries should be built backwards from it. If festivals call you, Guanajuato's Cervantino in autumn is the plateau's great gathering; plan everything else around it.