Instead of CloseLoot() you could also accept all the loot using LootSlot(x) where x is the slot in the bag, I use:

/run LootSlot(1)/run LootSlot(2)
/run LootSlot(3)
/run LootSlot(4)
/run LootSlot(5)
/run LootSlot(6)
/run LootSlot(7)
/run LootSlot(8)
/run LootSlot(9)
/click StaticPopup1Button1
That accepts all loot and any "are you sure it will bind to your character" type message.