Q:

I can't seem to get dialog to destroy from within the dialog function

When I try 'destroy' I get an error:

Error: cannot call methods on dialog prior to initialization;
  attempted to call method 'destroy'

As you can see the dialog is created on the fly.
selecting "no" destroys it just fine.
I assume that because I am in a post function I am not able to use $(this) but I don't know why or how to access the dialog as it was created on the fly.   
 $('<div title="Apply for Position"><label>Do you want to apply for the <em>'+pos_title+'</em> position?</label></div>').dialog({
        modal: true,
        buttons: {
            'yes': function(){
                $.post('/user/handlers/job-actions.php', {ep_id: ep_id, type: 'apply', event_id: event_id}, function(r){
                    if (r.status === 'complete'){
                        button.html('<span class="halfsprite halfsprite-round_remove"></span>withdraw');
                        button.removeClass('apply');
                        button.addClass('withdraw');
                        $(this).dialog('destroy');

                    }
                    else{
                        console.log(r.msg);
                    }
                }, 'JSON');
            },
            'no': function(){$(this).dialog('destroy');}
        }
    });

A:

The problem is that this is in the callback function of the $.post request, so it's context has changed. Try saving your dialog HTML off into a variable and reference that variable throughout your functions like so:
var $dialog = $('<div title="Apply for Position"><label>Do you want to apply for the <em>'+pos_title+'</em> position?</label></div>');

$dialog.dialog({
    modal: true,
    buttons: {
        "yes": function(){
            $.post('/user/handlers/job-actions.php', {ep_id: ep_id, type: 'apply', event_id: event_id}, function(r) {
                if (r.status === 'complete') {
                    button.html('<span class="halfsprite halfsprite-round_remove"></span>withdraw');
                    button.removeClass('apply');
                    button.addClass('withdraw');
                    $dialog.dialog('destroy');
                } else {
                    console.log(r.msg);
                }
            }, 'JSON');
        },
        "no": function() {
            $dialog.dialog('destroy');
        }
    }
});

