If you put the socket in non-blocking mode, it will allow the script to continue running.
socket_set_nonblock($socket);
I'm not 100% sold that will solve your problem since I don't know what the rest of your script is doing.
Someone built a socket interface to AIM and I added a socket server to it (to allow for interaction between the IM client and the server). When running on my Pentium 100Mhz machine, there's no load and only a slight load when there's IM activity. The scripts can be found here at the bottom: http://www.rsbauer.com/webdev.php (look for aimsocket.php)