It's simple present imperative, just like the second. They just have the adverbial of purpose ("to...") phrased differently.
The first uses a catenative, where a verb takes another verb or verb phrase as its argument. Avoid is catenative, with having to do the dishes as its argument. To have here can also be described as a catenative verb, but it's easier to just think of it as a modal auxiliary showing obligation.
As a catenative, avoid takes a gerund or gerund phrase, representing the action that you are avoiding. That action is having to do the dishes. Thus, it is avoiding the obligation to do the dishes. You could simplify it by removing the explicit obligation:
Do this to avoid doing the dishes.
In all of these versions, the principal verb is the first do, and the other verbs - avoid, having, and the second do (whether it's negated or not) - are in non-finite forms, and have nothing to indicate time. Non-finite verbs can have indications of time, but often they do not. Thus, there is no difference in time between them - one simple expresses, with clarity, that doing 'this' will allow you to avoid the obligation to do the dishes. The other says that doing 'this' will allow you to not do the dishes. The eventual meaning is the same, the difference is there but is not of practical importance, and there is no difference in time between the two.