Why didn't you just save the file or get it from the server on startup and read them in to an array rather then doing all those if statements?
It's a continuing work, but if you look at TBHT.Bot.Parser.js, you'll see the beginnings of a scripting engine I'm putting together to allow bots to be scripted with something like:
http://junt.pastebin.com/E9jStTrN