Someone pointed me to the Fire source, but I didn’t like that implementation; it made the windows snap after you dragged, giving an unpleasant “bobbing” effect, like the way an air-filled bottle bobs back to the surface of the water after you push it down. (Incidentally, Fire is a fabulous app. If you need to manage multiple instant messaging accounts on several different services – including MSN, AIM, Yahoo and ICQ – then you really should be using it.)
Anyway, I implemented my own snap-to-edge windows, and I’ve finally gotten around to cleaning up the source, adding plenty of comments, and making it available. You can grab the source (including a sample app) here (55k StuffIt archive as Binhex).