How can I get WordPress to save comments in markdown format?

This is a tricky one, but very doable.
After looking at Mark’s Markdown on Save plugin which does the exact thing you want but for posts content instead of comments i started thinking, that saving the comment content as Markdown would be bad because you would have to render the Markdown to HTML on-the-fly for each comment you display so the idea behind that plugin is that it saves the Markdown version as postmeta data and only displays it on the edit screen.

So that is exactly what you need to do and i can help you in getting started.

First you need to save the Markdown version of the comment content in the comment meta table using update_comment_meta and hooking it into wp_insert_comment which fires right after the comment is inserted in to the database:

//on comment creation
add_action('wp_insert_comment','save_markdown_wp_insert_comment',10,2);
function save_markdown_wp_insert_comment($comment_ID,$commmentdata) {
    if (isset($_GET['comment'])){
        $markdown = $_GET['comment'];
    }elseif (isset($_POST['comment'])){
        $markdown = $_POST['comment'];
    }
    if (isset($markdown)){
        update_comment_meta($comment_ID,'_markdown',$markdown);
    }
}

Then you need to show it on the comment edit screen using get_comment_meta and we hook it into comment_edit_pre filter which fires before the edit comment screen is displayed:

//on comment edit screen
add_filter('comment_edit_pre','load_markdown_on_commet_edit',10,1);
function load_markdown_on_commet_edit($content){
    $markdown = get_comment_meta($comment_ID,'_markdown',true);
    if (isset($markdown) && $markdown != '' && $markdown != false){
        return $markdown;
    }
    return $content;
}   

And Last we once again need to save the new Markdown version of the comment as comment meta data using once again update_comment_meta and we hook it into edit_comment which fires after a comment is updated/edited in the database:

//after comment edit screen
add_action('edit_comment','save_markdown_after_edit',10,2);
function save_markdown_after_edit($comment_ID){
    if (isset($_POST['content'])){
        update_comment_meta($comment_ID,'_markdown',$_POST['content']);
    }
}

Now I’m not sure how safe and secure this is or if this even works but it looks right to me and i’ll leave this as a community wiki so everyone who knows better is welcome to correct me.