October's article
here goes into the use of the hardcoded $ITEMSTATE variable although the rest of it isn't particularly relevant to what you're trying to do.
My advice, honestly is just to do away with the actual items and just use link restrictions to drop/pick up 'items' tracked within the story itself. But it is possible to use $ITEMSTATE to check if the player is holding a particular box and add to a %WEIGHT variable based on that. There'd have to be an intermediate page between picking them up and actually trying to cross the river so that the variable changes could kick in. After that the link to the river could check that they don't exceed the maximum weight redirect them to a try again or failure page.
Anyhow, you may want to wait a bit, I'm sure someone else will show up with a simpler and more elegant solution because that's always what happens.