The initial amount paid is posted as a check expense to Other Current Asset = loaned to another.
The entry for the vendor as Vendor Credit is going to use that same Other Current Asset account as the Expense reason. Now you have this AP Credit to use in Pay Bills.