This is not so hard to understand as it user js, php and css.
You should dig in the code of my chatbox, in the following elements:
- The $chatline_ondblclick in the mgc_chatbox.php file which shows the bit of code which is inserted in the tag where you want to be able to edit on double the content
- The following functions in the mgc_chatbox.js file : inline_chat_edit (called on double click, it do the ajax sending), attente_recup_data_edit (waits for the returns of the ajax call), show_edit_chat (replace the current content by the input field), lancement_save_edit (called when the event onblur is fired by the input field, it manages the ajax call to save edited data), and finally attente_save_edit (waits for the return from the saved edited data ajax call).
- The have a look in the mgc_chatbox.php file, the ajax_edit_getchat and ajax_save_edit DO which are the part called from the ajax.
This should help you a bit I think, but I can't spend time to explain you in details, time is preciou and I haven't that much (full timetable

)