How to pull code snippet from functionality plugin?

You’re trying to echo <?php tags, but that won’t work: they won’t be processed. Instead you need to replicate that logic in PHP statements in your function instead. Here’s a partial answer:

function epf_extra_buttons( $post_ID ) {
    // TODO: where does $es_settings come from?

    $encoded_permalink = urlencode(get_the_permalink());
    if ( $es_settings->share_facebook ) {
        echo '<a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=" . $encoded_permalink . ""><i class="fa fa-facebook" aria-hidden="true"></i></a>';
    }
    if ( $es_settings->share_twitter ) {
        echo '<a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=" . $encoded_permalink . ""><i class="fa fa-twitter" aria-hidden="true"></i></a>';
    }
    if ( $es_settings->share_google_plus ) {
        echo '<a class="a2a_button_google_plus" href="https://www.addtoany.com/add_to/facebook?linkurl=" . $encoded_permalink . ""><i class="fa fa-google-plus" aria-hidden="true"></i></a>';
    }
    if ( $es_settings->share_linkedin ) {
        echo '<a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/facebook?linkedin=' . $encoded_permalink . '"><i class="fa fa-linkedin" aria-hidden="true"></i></a>';
    }
    if ( $es_settings->use_pdf ) {
        $pdf_url = add_query_arg( "es-pdf", get_the_ID(), get_the_permalink() );
        echo '<a href="' .esc_url( $pdf_url ) . '" target="_blank"><i class="fa fa-file-pdf-o" aria-hidden="true"></i></a>';
    }
}

add_action('es_wishlist_add_button','epf_extra_buttons');

Note that I’ve added some escaping and URL encoding that you were missing. I’ve also added $post_ID as an argument as you can see from the do_action call that it’s passed in.

However this won’t work as is, because you don’t have the $es_settings variable available in this function. You’ll have to work out where that comes from: is it global? Can you look it up or compute it from the information you do have, which is the $post_ID?