How to use wp_update_post with ajax on frontend

hmmm…. I don’t see a problem with your code. When I run into 500, it’s usually due to permissions or htaccess mis-routing the request.

That said, some things to try:
1) in wp-config.php, set debug WP_DEBUG to true. This may offer a more descriptive error message.

2) WordPress has good integration for AJAX. You can define a url to retrieve all ajax requests, and then handle the request from functions.php by adding an action. Check this for more info: http://codex.wordpress.org/AJAX_in_Plugins. I use the approach therein described quite often without incidence.