Setting a Drupal.settings JS variable from a form field
Adding the value of the new field wt_comments_share to $_SESSION['wt_comments'] is considered a good idea.

Because you're using session to pass values, you don't need to pass it to Drupal.settings unless if you want to add new JS file.

To add javascript code to node view you need to use hook_init or template_preprocess_node

function wt_comments_init() {
  // check if page is node and wt_comments is set
  if($node = menu_get_object() &amp;&amp; isset($_SESSION['wt_comments'])) {
    // check users allowed to comment on this node
    if($node-&gt;comment) {
      // add javascript code
      drupal_add_js("jQuery(document).ready(function () { 
            if ( Drupal.settings.wt_comments.wt_comments == 1 ) {
              // dance around! jQuery('body').css('background-color','green');
            }
          });",
       'inline'
      ); 

      // unset session wt_comments
      unset($_SESSION['wt_comments']);
    }
  }
}