When you put your Mac in sleep mode, the whole computer is MOSTLY "off." The hard drive spins down, power is turned off to certain ports.... the only things that really get power are the processor and the RAM. As a precaution, any IM software worth it's salt will automatically sign you off as you close the lid. Otherwise, you would appear to be online, but your computer wouldn't get any of the messages.
The only way to keep AIM online is to keep the computer awake.... hard drive spinning and all. There are certain utilities out there to keep your computer awake with the lid closed.... but.... be fore-warned... your hard disk will still be spinning. If you're transporting it while it's fully awake, YOU RISK DAMAGING THE HARD DISK.
You have to live with it, really. Sorry about that. Guess you'll have to live with e-mail.