Will store chat through disconnects, relogs and char change. Allows manual copy and paste. Can't help you with a write to file addon, since afaik the API does not allow output to anything but the SavedVariables-file, which in turn probably needs an external reader to convert to readable text. And probably is too size limited to be useful.
There are two options that I can think of.
1) When ever you log into the game, type /chatlog and all you chat will be recorded into a .log file, which you can open with any text editor. (not really an addon, but is built into the game and is available.