Because God's promise to Abraham was written in the scripture before Christ fulfilled the promise, the scripture is like someone who knows the future before it happens and who preaches the gospel. Alternate translation: "In the scripture, God showed before it happened ... faith, and he presented the gospel" (See: [[rc://en/ta/man/translate/figs-personification]])
The word "you" refers to Abraham. Ultimately God would bless the nations through one of Abraham's descendants. Alternate tranlation: "Because of you" or "Through you"