Comment Re:GAIM (Score 5, Informative) 88
MattCohn's right in that Gaim is the program you want to use, but the good news is your don't even have to gut the code!
Gaim supports perl plugins, which can even act as AIM Bots. So, what you could do (quite easily in fact - download Gaim, unpack and read the doc on Perl modding in one of the source code subdirectories) is write a bot that stays online, listens for your commands, and then executes them on your machine.
However, you may want to be careful as someone could easily execute malicious code on your computer!