i believe the correct translation is to keep instruction and not keep the law.
I don't believe vision means dream, and I believe vision in this verse and elsewhere refers to visions that come from God.
Acts 2:17 - And it shall be, in the last days saith God, I will pour out of my Spirit upon all flesh; and your sons and your daughters shall prophesy, and, your young men, visions shall see and, your elders, in dreams shall dream, - (rotherham)
gGod
i can tell you what my visions from God are like, It's like you're imagining it, except it's stronger, sometimes much much stronger, except that the imagination comes from God and not yourself. Also, the stronger the vision is, the more it feels like a vision and not your own imagination. I"ve had visions so strong they would knock me out of my socks so to speak and on the other extreme i've had visions from God that were very weak so that i wasn't sure if it was a vision or just my own imagination.
So I think visions in proverbs refers to these type of visions