Creating a give command queue

ok so Im creating a datapack where you get rewards (a vault with custom loot) when achieving custom advancements. I have a score that checks if the player inventory is full. what I want to do now is that I want to give the reward to the player IF he has an empty slot. if he doesnt, then the reward should be added to a queue that checks every now and then if the player has an empty slot to then give him the reward.

i have no idea how to do that and I need big help

Continue to help post