modify buddpress adminbar only in admin pages

You ca use the conditional tag is_admin() to check if you are on the front-end or back-end like this:

function bp_adminbar_currentsite_menu() {
    global $bp;
    if (!is_admin()){
        ?>
        <li>
        <!-- Insert your link url or relative url, and your link text below -->
        <a href="http://EXAMPLE.COM">EXAMPLE LINK TEXT</a>
        </li>
        <?php
    }
}
// Call The Function Above
add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999);