Sorry, missed this is over 11 years old :).... hope you got it sorted :D
surely var section = <Xrm.Page.Section>Xrm.Page.ui.tabs.get(tabName).sections.get(sectionName);
will compile in the way you specified in the "correct javascript syntax should be" bit?