This verse comes in two parts. The first two lines parallel each other, and the last two lines parallel each other. "An appointed time" and "at the end" mean the same thing. In Daniel 12:4, God tells the prophet, "But you, Daniel, shut up the words, and seal the book until the time of the end" (see also Daniel 8:17; 10:14). God is telling Habakkuk the same thing. The message was not necessarily for him and the people of his time. It is for the herald who runs and the people he will deliver the message to. It will be sealed until the appointed time, then it will be revealed.
This, then, is a revelation for our time today. He says, "At the end it will speak," an interesting image. It literally means the message will pant, like a runner after a marathon. Again, it is the heraldry image. The herald runs for miles with his message, and when he arrives, he is out of breath, panting. Then, he speaks his message to the recipient before he has recovered his breath, emphasizing its urgency. It must be given at the right time because things will happen swiftly, and the recipient must be ready. The wording mixes excitement with fatigue and urgency, a messenger rushing to get the words out because of shortness of time and breath!
God immediately reassures us that the message is truth. It will not lie. It will come. It will begin to be fulfilled right away. But it is God's truth, so we should believe it!
"Though it tarries, wait for it; because it will surely come, it will not tarry" is also a parallel construction. God is saying, "Be patient. If things seem to be delayed, it is only your perspective because it will come right on time. I do things when I want them to happen."
What is the vision? In Hebrews 10:35-37, Paul not only quotes this verse, but he interprets it for us.
Therefore do not cast away your confidence, which has great reward. For you have need of endurance, so that after you have done the will of God, you may receive the promise. For yet a little while, and He who is coming will come and will not tarry.
What God has promised is His rest. The Israelites could not enter into His rest because of their unbelief (Hebrews 4:1). They showed no endurance. They did not see it all the way through to the end. So Paul says we need endurance to claim our reward.
Though the wording is somewhat different, the meaning is the same. Paul explains that what God told Habakkuk is, "Christ is coming!" That is the vision! That is the urgent message that we must understand—and not just that He is coming but all the end-time events too. Bad things and good things accompany His coming. Which side will we be on? The side that gets the bad things? Or the side that gets the good things? This is the revelation, the vision, that Habakkuk receives from God: that Jesus Christ, the Messiah, would come and solve the problems he is so worried about.
How does this answer his question, "Why do You use the wicked to punish us, who are the righteous?" Revelation 11:15-18 provides the answer. Because everything will be squared in the end; God will punish the wicked and reward the just. We have no need to be worried about why the wicked seem to prosper and the righteous are persecuted and killed. He soothes Habakkuk's troubled mind by giving him a dose of reality. The horrendous things God predicts will still occur, but they are His will, part of His plan. But events must take this course to produce the right fruit in the end. It will all be sorted out. No evil deed will go unpunished, and no good deed will go unrewarded.