How to add comment on scripts using function in wordpress?

There is a generic way to use conditional comments – for styles. But unfortunately not for scripts until #16024 will be fixed. The details are described in this answer.

To make your themes scripts filterable you could use a callback on wp_print_scripts and apply a custom filter in there.

/**
 * prints a conditional comments wrapped script
 *
 * @wp-hook wp_print_scripts
 * @return void
 */
add_action( 'wp_print_scripts', 'wpse_135545_enqueue_print_script' );
function wpse_135545_enqueue_print_script() {

    $params = apply_filters(
        'wpse_135545_enqueue_print_script',
        array(
            'url'     => 'http://html5shiv.googlecode.com/svn/trunk/html5.js',
            'version' => '1.0',
            'cond'    => 'IE'
        )
    );

    if ( empty( $params[ 'url' ] ) )
        return;

    printf(
        "<!--[if %s]>\n\t<script src=\"%s\"></script>\n<![endif]-->\n",
        $params[ 'cond' ],
        add_query_arg( 'v', $params[ 'version' ], $params[ 'url' ] )
    );
}

A plugin or child theme author can now handle this by either changing the parameter via the filter or remove the hook completely. (By the way, the version parameter does not make sense on combination with a url to the trunk. You may consider to link to a fix version of the script.)