mind if I make a suggestion?
on *:TEXT:!give*:#: { if ($2 == cookie) { ...commands } if ($2 == cake) { ...commands } ... }