Yes, it's possible to write such a script but it's pretty lame in my opinion. It's done by an "on text" event. When it detects certain text, such as text of a trivia question then it auto-responds with an answer.
he isn't beating you, the script is. basicly its lame to make a cheat-bot, so tell him how lame it is and be happy. you might also complain (if they care) to the ops in the channel, if you are actually competing then he should be disqualified.