Well it's pretty obvious that if you place a player.chat = "bla"; before an else if that your code will break:
PHP Code:
if (bla) {
}
player.chat = "hi";
else if (bla2) {
}
This will obviously not work... so I don't think that it has anything to do with your syntax really lol