Do any of the D&D guidebooks or rulebooks, from any edition, state what should be done when a Lawful Good character is faced with a dilemma where "being Good" would require breaking the law, and "being Lawful" would require not "being Good?"
Yes. In every edition, the character would make a decision according to their personality, preferences, and circumstances.
Having an alignment is just the beginning; How a character acts within their alignment, and why and how they violate it, are what makes adherence to an alignment interesting. In much the same way as playing any character torn between two conflicting ideals or beliefs is interesting, really.