Relocate your if($item ...) block to a new sub, EVENT_ITEM.
Code:
sub EVENT_SAY
{
if [text x] then do action y
etc.
}
sub EVENT_ITEM
{
if [item x] then do action y
etc.
}
Probably the $item variable is getting pushed to your script when it attempts to run EVENT_ITEM, but since the sub does not exist, there is no effect, other than assigning the variable a value inside the module. Upon the next hail, EVENT_SAY is triggered again, and the $item variable now has the expected value assigned.