How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?

A simple solution would be to wrap it in a check for a custom $_GET var:

if( isset( $_GET['showmethething'] ) ){
    // do stuff
}

Then add that var to whatever URL you want to trigger the code:

http://example.com/somepage/?showmethething