Where do I add my own javascript or jquery so that it executes after the DOM is ready in Drupal 7?
There is a syntax error in above code. Change the js file contents to below. It will work as you expected !

jQuery(document).ready(function () {

    // Make the parent menu item of the active sub-menu item also active.
    jQuery('#block-system-main-menu li.active-trail &gt; a').addClass('active');
});