For a while, inspired by the Django Book, I toyed with the idea of doing something similar for screenplays and building a community where people could offer feedback on those or other creative writing endeavors. It ended up looking like I'd have to implement it myself, but if you're building a web application already then this feature alone shouldn't add too much to your dev time.
My naive plan was just to give each comment-able item (eg. a paragraph) a specific ID, and having a many-to-one relationship with comments to paragraphs. I never followed through, so I'm not sure what pitfalls you'd likely encounter doing it that way.