Halliday & Matthiessen (2014: 165):
Historically the forms do, don’t derived from non-finite forms of the verb do, but they now function analogously to the Finite operator in an indicative clause; compare the dialogic sequence Look! – Shall I? – Yes, do! or No, don’t!, with the response consisting of Mood element only.