This is one of my Max/MSP abstractions I got some mileage from. Very messy to study but works pretty well. In a nutshell Recorder9 is a bpatcher abstraction providing user-friendly UI for real-time recording/looping (using groove~ object). The UI should be hopefully self-explanatory and the package comes with a demo patch with sounds included. It's been posted here on request...
http://ico.bukvic.net/Max/Recorder9.zip Enjoy!