Though I see no connection between the two places in scripture, "overly" righteous tends, at worst, to self-aggrandizement or snootiness...perhaps.I don't see the word "unrighteous" in Ecclesiastes 7:16 but I think it is implied by the fact that only the unrighteous would have any problem with people who are doing righteousness. The teacher of Ecclesiastes is saying that by being overly-righteous, we risk destroying ourself. Jesus said a similar thing in Luke 16:1-12.
As the "teacher" of Ecclesiastes dealt with "vanity" in a lot of his "sayings", his "overly" being "destruction" would seemingly imply a lack of "moderation in all things".
In other words, "What's the point?"
Motive establishes whether or not something is "overly...".
Don't you think?
Matt 7:6 might fill the bill..."Give not that which is holy unto the dogs, neither cast ye your pearls before swine, lest they trample them under their feet, and turn again and rend you."That's an interesting idea ... do you have scripture to show that? I am thinking of Luke 11:33. How can that fit with your saying that there is an appropriate time to not manifest His son on Earth?
Paul's not going into the "theatre" at Ephesus is another example of the wisdom of "holding one's tongue" too. (Acts 19:24-31)