Answer:
In my experience, you'll want to have any guarantee agreement set up in advance of a loan closing, since you may be relying on the guarantee to approve the loan. But it's not uncommon to have the guarantee actually completed and signed at the closing.