In a subordinate clause with the subjunctive, the tense depends on whether the main verb is present or past and on whether the action is at the same time, earlier or later.
Translate by the English time, not the Latin form: Memento, quamdiu ista distuleris "remember how long you have put things off" (perfect = earlier); quid ageretur after a past verb, "what was going on".
foret = esset. Result clauses may break the rule, with a perfect subjunctive after a past verb for an actual result.