You can insert HTML into CS6 and later but if you’re working on EPUB you
really need to move to Creative Cloud.
I recommend downloading the trial and giving it a try yourself.
The best source of information about creating EPUB in InDesign I know of is Anne-Marie Concepcion's tutorials on www.lynda.com. Here's a link to here introductory tutorial on EPUB from InDesign CC 2014:
You can get a week free at Lynda.com.
modifying the syntax or the DOM directly in InDesign is not possible in CS4 and very limited in CC.
In terms of ePub, InDesign is a conversion tool based on best practice experience for the code it creates. It does not let you define your own structure or wrappers.
Thanks Yves. It's unfortunate I can't write HTML directly in the InDesign document. InDesign CS4 generates horrendous HTML, but it's a good starting point.