JS Plugin not executing the js correctly. Trying to make all internal links scroll smoothly

Save your JavaScript code out to a separate file within your plugin directory. Then use this code to load the file using the wp_enqueue_script() function.

function smooth_scrolling_links() {

    if ( !is_admin() ) { // Don't load if in the admin screen

        wp_enqueue_script('Smooth-Scolling-Links', plugin_dir_url(__FILE__) .'-YOURFILENAME-.js');

    }
}

Obviously replace the -YOURFILENAME- with the file name that you created.

You may also need to modify your JavaScript slightly to comply with the jQuery noConflict wrappers. You can see the codex document here with a full explanation.

Edit to show jQuery noConflict wrapper

You also need to change –

$(document).ready(function() {
    $().smoothscrolling();
})

To this –

jQuery(document).ready(function(){
    jQuery(#smoothscrolling) ...
});