Proverbs 26:4-5
4
Do not answer a fool according to his folly,
or you yourself will be just like him.
5
Answer a fool according to his folly,
or he will be wise in his own eyes.
How do you distinguish between the two?
You distinguish by treating the passage as one rather than two proverbs. Like this:
Do not respond to the foolish according to his folly, lest you become like him; respond to the foolish according to his folly, lest he imagine himself to be wise.
(Proverbs 26:4-5)
The advice then is not to respond in kind with a foolish rejoinder but instead respond with wisdom so that the fool will not think himself wise in the foolish things he's said (or written).
adding some internal commentary to the verses it can be worded thus:
Do not respond to the foolish according to his folly, lest you become like him [by speaking foolishly yourself]; respond [with wisdom crafted to refute his folly and so show] to the foolish according [that his words are folly, as his folly requires, thus showing the foolishness] to [of] his folly, lest he imagine himself to be wise.
(Proverbs 26:4-5)
But I have added and changed several words in the text so you may disagree, but I think it is a reasonable reading of the passage.
Kudos to Arsenios for citing the LXX (translated into English)
Here we are instructed to answer a fool according to his folly...
Not in order that we become like him...
But in order that he not become wise in his own eyes...
Two ina (in order that) clauses conjoined by alla (but instead)
God Bless the Septuagint!
Arsenios