Early on, we see a man who underestimates those around him. He feels as if he needs to dumb down the speech he is making so that those at the party can understand it, yet it is clear from the small talk that many are quite sophisticated in their understanding of politics, music, and culture. He is disdainful about Ireland, preferring to spend his time elsewhere. He treats his wife patronizingly. This sense of superiority is ripe for a fall, the fall of course that occurs at the end of the novella--the discovery of his wife's past, a past that involved more passion than anything that he himself was able to give her, that the country lad Michael Furey in his short life could love with such intensity. It's almost an apology for Joyce's harsh portrayal of the Dubliners in the earlier stories of the work; through Gabriel, Joyce acknowledges the beauty and strength of the Irish.
In one sense, Gabriel's awareness is prepared for in Joyce's portrayal of his spiritual paralysis. For, he is spiritually dead and his name suggests his future announcement to himself that he soon will join the dead.
Very interesting question you have asked here. One way of approaching this question would be to think about the encounters Gabriel has with other people and how he reacts and what is revealed about him. I can´t think of any definite foreshadowing, but through his encounters we definitely are introduced to a character who, at some levels, is very unhappy within himself and is a man in conflict in lots of different ways, which therefore raises the expectation that there will be some kind of an epiphany at the end of the story.
How is Gabriel's moment of self-knowledge and self awareness prepared for earlier in the story?
I think it is quite appropriate to connect the end with the beginning to provide an answer to this question. Gabriel comes into deep self-realization after he hears from Gretta of the love she received from Michael Furey. At the beginning, his encounters with the servant Lily with his inappropriate and casual remark foreshadows the self awareness presented at the end of the story