At my little guy's party outside a theme park, where we had tables reserved but people were free to wander, I had children coming to admire the Elmo cupcakes I'd made. From their own parties! So I knew they had cakes and goodies of their own. But, I had extra and I offered, to kids and adults, and gave happily to those who asked. I love to include children such as the one you encountered, wherever we are, because the world is an ugly place without kindness. We never know what they are facing in life, one gesture can make or break their day.
You did what worked for you, so be content. It personally wouldn't work for me.
_______________________
ETA - Thanks for your shower analogy, this actually happened at my sister's bridal shower. A woman sneaked in and was helping herself to food, (buffet), my sister asked me who she was, I'd never seen her, so she walked up to her and asked. The woman got defensive and walked away, yet kept coming up to my sister, interrupting her and the festivities. I took her aside and said, "Look, we don't know you, this is my sister's shower, please be respectful and leave here." She promptly burst into tears, said she and her husband were out of work, their two kids were hungry, she'd hoped to get them some food. (In her defense her plate was covered, she hadn't touched it, she planned to take it to them.) My head was reeling, I'd been ready to be tough and I couldn't. I explained to my sister, I put together food for her family, included her in the shower games/talk, arranged a ride home for her and the food, got her phone numbers and addresses she could contact on Monday for help, and cried when she was gone, that I could have made her leave because of her unorthodox way of trying to feed her children. She and my sister became good friends and still are 15 years later, her employment situation changed for her and her husband, her family's life turned out good, and I wouldn't change anything I did. She was in that place at that time, as was I, for a reason.
You were free to do as you chose at the party, and you were curious if we'd dealt with similar situations, I have.