I assume you are talking about her thoughts while standing on the scaffold. Hester is consciously "checking out" while on the scaffold in order to endure the shame of this punishment. More importantly however, this flashback actually gives the readers necessary information for the rest of the book and foreshadows the identity of a new character.
In this flashback we learn a couple of things about Hester. First, she was married before she came to the New World - to a scholar/doctor. The man is generally described as old, unnactractive, learned and respected. A key detail is that one shoulder was higher than the other. Hester "never feigned" love for this man, even though he did what he could in his old age to provide for her. We also learn that he sent Hester on to the New World ahead of himself, he would follow after wrapping up some loose ends. He never showed up. It was assumed that he either shipwrecked, or landed and was taken captive by "savages."
Consider the implications of this information. Hester is/was unhappily married or widowed. Either is equally worse for her in her situation. Adultery between two unmarried adults would have been one thing in the colony - but in this situation, at least one of the sinners was married to someone else - which is worse. Then, at the end of the chapter, a man with one shoulder higher than the other has enters the colony with a "savage," catches eyes with Hester, and raises his finger (likely in a gesture of "shhh"). This is pretty obvious foreshadowing that Hester's "husband" has returned. How timely.