What should be the correct auxiliary verb, did or do? [duplicate]

Solution 1:

Given the example of the spilled sauce, I would say “if you ever do that again”- this usually introduces a future threat “… I will pull your arm off and beat you to death with it.”

“if you ever do that again” has an immediacy to it and usually follows the action.

“if you ever did it again” is very context dependent but mainly expresses an opinion or advice given some time after the event:

A: “Yesterday, I climbed on the roof and fixed a hole.”

B “Good… but if you ever did it again, I would suggest that you use safety equipment.”

A: "The judge fined me £250 for stealing a TV."

B: “You were lucky – but if you ever did it again, he would send you to prison.”