"The Wedding Guest beat his breast” is repeated in lines 31 & 36 in "The Rhyme of the Ancient Mariner." Why is this important?
Repetition in poetry is used for emphasis. These lines appear at the beginning of the poem. The Wedding Guest has been detained by the ancient mariner for reasons he does not yet understand. The mariner's tale begins, and the Wedding Guest can simultaneously hear the music and envision the guests moving into the hall.
The key to the line you mention is that the Wedding Guest is extremely frustrated. He is going to be late to the wedding or miss it altogether because of this mariner. Why doesn't he just leave? He cannot. Consider the following stanza:
He holds him with his glittering eye -
The Wedding-Guest stood still,
And listens like a three years' child:
The Mariner hath his will.
For some reason the Wedding Guest is compelled to remain and hear the story. Thus, the beating of his breast, his frustration at being powerless is emphasized in the lines you mention.