@Poryg Helped me with this a couple of weeks ago. What I did is make two variables: One is the maximum inventory limit, let's say 8, and the second variable is the current inventory count. then use this script call:
var itemCount = 0;
for (var i in $gameParty._items) itemCount += $gameParty._items
;
$gameVariables.setValue(x, itemCount);
And replace x with the current inventory variable. This call will check the inventory and add all items currently in the inventory to the variable count. Now when you make your event put that script call first and make a conditional branch that checks the Current Inventory Count against the Maximum Inventory Limit. If the Current Inventory Count is lower then the Maximum Inventory Limit then the player gets the item and you use the self switch to move it to the next page, if not then tell the player they don't have space for it and let the event end.