Before Ecclesiastes 7:7, the writer describes how he hates the songs and
laughter of fools. Maybe Ecclesiastes 7:7-8 says "because the oppression will
make foolish a wise man, and it will be destroyed (will perish) with a
teller's heart, better is a word's end (things end) than is its beginning."
Maybe he considers the foolish person's jokes about wise men to be oppression
that ends when the teller's heart stops (the person dies), so the end of a
speaking is better than its beginning. This is a wild guess, but I think it
makes a little sense.