An alternative to what you're doing in your OP is to use a for() loop
PHP Code:
temp.chatArray = {
"First", "Second", "Third"
};
for (temp.i = 0; temp.i < 3; temp.i ++) {
this.chat = temp.chatArray[temp.i];
//Use waitFor() instead of sleep
waitFor(this, this, 1);
}