with modern syntax, you only need one 'loop' and no vars:
note that .sort() is being used as a poor-man's forEach for IE8 compat...
you can simply append a new rule to the CSS, and it will over-ride previously defined rules of the same specificity:
var sheets=document.styleSheets; //get all sheets
var sheet=sheets[sheets.length-1]; //get most recent sheet
sheet.addRule("ul.dropdown li", "float:right"); //add rule to sheet