Old editions of Harbrace had a note under Rule 28D that read as follows: Avoid the confusion arising from the repetition in the same sentence of a pronoun referring to different antecedents.
CONFUSING Although it is very hot by the lake, it looks inviting. [The first it is an idiomatic pronoun; the second it refers to lake.]
CLEAR Although it is very hot by the lake, the water looks inviting.
Newer editions state it [this note] a little more specifically: Avoid the awkward placement of it near another it with a different meaning.
AWKWARD It would be unwise to buy the new model now, but it is a superior machine. [The first it is an expletive. The second it refers to model.]
REVISED Buying the new model now would be unwise, but it is a superior machine.