No doubt, the word "for" as a preposition also means "towards" or "in the direction of," but you don't use it in this sense with the verb "walk." You usually use to/towards with the walk.
You can use "for" to refer to the extent of time or distance you walk as follows:
He walked for five miles.
I had to walk for two hours to get to the airport.
On the other hand, it's appropriate to use this preposition in the sense of "to/towards" with verbs "run, make, head," etc.
So the use of the phrase "head for" in the sentence #1 is idiomatic and grammatical.
If you want to replace this phrase, you can do so with "run for" or "make for," which are more appropriate in the context of this sentence. These phrases means "to head for," especially fast and in haste.