Gym battles also have timers, so DPS should not be disconsidered (hence, Blissey on offence is out).
I'd say DPS is more important when you want the job done faster, e.g., taking down a gym before a raid starts. If the defenders don't care berrying anyway, then TDO from more bulky attackers, like Metagross, is more important, as it will cost you less healing items.
Which one (DPS or TDO) is more important really depends.