Normally, if AIM disconnects, the Internet line's been disrupted.
With a cable connection, there are seasons when mine goes out for seconds at a time. It'll seem like lag if something like this happens.. it'll delay a couple of seconds, grey out the send button, and then send once the connection is back. If it's out for longer, it'll seem to freeze, much like you've described.
My advice would be to first test this theory, to see if it's your Internet connection. Try to catch it when it begins this, quickly, and open up your browser (Internet Explorer, Netscape, Firefox, etc.), and immediately Stop the home page loading (if it's already loaded, that's okay), and then hit Reload. If it doesn't reload right away, or unusually slowly, I'd assume it's the Internet connection.
If you believe it's AIM, I'd save your buddy list and back it up, then uninstall AIM (for good measure), then reinstall with the latest version. Just use the standard stand alone version as opposed to the versions built into browsers or site-based versions. AIM's known to be highly reliable and I've never heard of an issue with it before.. not that it isn't possible, but it would be unusual.
Btw, I've assumed you're talking about the AOL Instant Messenger that isn't actually a part of the AOL web service. If you're using AOL webservice.. as an Internet user.. I would have to advise you into getting into something more.. modern. However, this is beside the point. Just download the version of AIM that isn't part of the browser, and this would do you a lot of good.