The sense of "keep your heart" is that we need to exert more vigilance in guarding our minds than men do over anything else. Governments go to great pains to guard their installations, plans, and secrets, but God says that it is even more important to guard what we allow to reside in our minds.
Why is this is so important? Because our hearts, our minds, guide and direct everything we do, and if we do not guard and protect them from the ungodly ideas, beliefs, and entertainments, they can cause our spiritual downfall. It is in our minds and hearts that our characters are shaped, and if we allow perverse and unrighteous character to enter, the righteous character that God wants to see in us will never form.
The other instructions that Solomon gives spring from this. He tells us to ponder and control what comes out of our mouth and what we allow our eyes to view. He teaches us to make sure our feet stay on the right path, as well as to work on establishing our habits and manner of living, meaning we should not become involved in insensitive, hasty, careless, and destructive actions. The prophet Haggai puts all this very concisely, "Consider your ways!" (Haggai 1:5, 7).