The past-form clause names something already said, taught or preferred, and 하다 does exactly that. Half of these lines are the polite deferral do whatever is comfortable for you, the standard way of telling someone not to worry about you, and the rest push the other direction: just do as I told you, do as you were taught. Contrast 하는 대로 하다, which follows things as they unfold rather than an instruction already given.