Generate slug and meta data if meta field is empty

Ok, after a little playtime, here is the answer:

add_action('save_post', 'ocp_jobs_save_details');
function ocp_jobs_save_details(){
  global $post;
  $genref = sanitize_title( dechex( time() ) );
  if ( $post->post_type == 'job' ) {
    if ( $_POST['ocp_jobs_ref'] ) { $jobs_args = array( 'ID' => $post->ID, 'post_name' => strtolower( sanitize_title( $_POST['ocp_jobs_ref'] ) ) ); $myref = strtoupper( $_POST['ocp_jobs_ref'] ); }
    else{ $jobs_args = array( 'ID' => $post->ID, 'post_name' => strtolower( $genref ) ); $myref = strtoupper( $genref ); }
    if ( ! wp_is_post_revision( $post->ID ) ){
        remove_action('save_post', 'ocp_jobs_save_details');
        wp_update_post( $jobs_args );
        add_action('save_post', 'ocp_jobs_save_details');
    }
  }
  update_post_meta($post->ID, "ocp_jobs_ref", $myref);
  // Other update_post_meta functions
}

The wp_insert_post_data filter isn’t needed at all. It probably isn’t pretty or elegant, but it works.