Yet if hope has flown awayIn a night, or in a day,In a vision, or in none,Is it therefore the less gone? (6-9)
The image of hopelessness here foreshadows the speaker's defeat in the second stanza. It also foreshadows some of the emotional pain he endures as a result.
I stand amid the roarOf a surf-tormented shore (12-13)
These lines, like lines 6-9 also foreshadow the speaker's impending defeat. The "roar" of the ocean sure sounds ominous, and the image of a shore being "tormented" or assaulted by the surf reminds us of how the sand will also torment the speaker, because it's always falling away from him. The dude just can't win.
How few! yet how they creepThrough my fingers to the deep, (16-17)
The sands have a life of their own; they can "creep" through the speaker's fingers, back to the ocean. It's almost like they actively defeat him, and there's not a stinkin' thing he can do about it.