I the current javascript nukes optgroups by passing through each option element without regart to optgroupings...

here's an updated script snippet that should help:
in place of

$(this).find("option").each(function(){		
		var this_class="jquery_dropdown_option";
		if($(this).val()==select_default_value)
			this_class += " jquery_dropdown_option_selected";
			
		output += '<li class="'+this_class+'"><a href="#" class="'+select_id+'" rel="'+$(this).val()+'">'+$(this).text().replace(/ /g, '&nbsp;')+'</a></li>';
		  
		c++;
	});

put

  //build <ul> list here
  if($(this).find("optgroup").length){
	  $(this).find("optgroup").each(function(){
		  output += '<li class="jquery_dropdown_optgroup_label">'+$(this).attr('label')+'</li>';
		  $(this).find("option").each(function(){		
			var this_class="jquery_dropdown_option";
			if($(this).val()==select_default_value)
				this_class += " jquery_dropdown_option_selected";
				
			output += '<li class="'+this_class+'"><a href="#" class="'+select_id+'" rel="'+$(this).val()+'">'+$(this).text().replace(/ /g, '&nbsp;')+'</a></li>';
			  
			c++;
		  });
	  });
  }else{
	$(this).find("option").each(function(){		
		var this_class="jquery_dropdown_option";
		if($(this).val()==select_default_value)
			this_class += " jquery_dropdown_option_selected";
			
		output += '<li class="'+this_class+'"><a href="#" class="'+select_id+'" rel="'+$(this).val()+'">'+$(this).text().replace(/ /g, '&nbsp;')+'</a></li>';
		  
		c++;
	});
	
  }

the latter checks for optgroups... sloppy copy/paste, but gets the job done.

//TODO: breakout the existing code into a function and run it by function name rather than copy/pasting