If you don't care about nesting, you should be able to do a simple parse with a few GREPs. If you need to take nesting into account, your best bet is probably to use a state machine to parse it...
Google state machines for more info...
Yeah, that's what I did by way of experimenting with HTML Input/Output: write a state machine. It doesn't need to be very complicated either. If you can be (quite) sure your HTML is properly formatted -- preferably, correctly-formed XHTML is best -- all you have to do is "push" each open tag, then process the last one on "pop".
Since InDesign text works per paragraph, I think you'd best scan back for an "open P" tag (or, in the case of not-properly formatted HTML, any other block element), then insert all of the text text and apply formatting.
It's quite fun to write this -- up to a certain point, anyway.
A while ago I wrote this script:
It does not support the mentioned block-level tags, though.
For those you would add paragraph styles and hard returns, and don't forget to support the class attributes .