Try this instead..
NPC Code:
if (created) {
timeout=1;
}
if (playerchats) {
message test;
sleep 10;
}
if (timeout) {
message hmm;
}
^Now, instead of the npc immediately going from the playerchats to the timeout, it will 'sleep' for 10 seconds then it will execute the timeout. In your case, the number you specify for the timeout doesnt matter, but what matters is the number you specify in the sleep.