I use my own framework for my personal addons, but still you can easily see how the logic is in the code, in case you can't make anything out of it I could help turn it into a standalone addon.
http://pastebin.com/XGGsPy3G
*Edit*
I noticed you wanted an input based saving addon, mine is just a chat history one... in any case, here it is:
http://www.wowinterface.com/download...atHistory.html
About input logging I would recommend Prat, I know it can remember messages, but only those you sent, and yes even across sessions. Just make sure you check the right options so it does that, it won't by default.
Sorry for misunderstanding earlier.