You may disagree with me, but your rationale agrees exactly with what I was saying. If you try to pocket something and your inventory is full, you DON'T pocket it and you DON'T create it, you just say "Your hands are full." (or whatever the system message is) and nothing changes.
If you think your sample code is messy, you should see my code for 'Seeker of Magic' and 'The Witch's Apprentice', where I have to do this sort of thing over and over again. And I'm going to have to do it again for this one for 20 or so objects.