I confirm that the patch fixes the problem of unmatched </div> generation.
I confirm that your patch gives results similar to the ones achieved by original patch.
To get the best from this last patch you should change most occurrences of Node.traverse() to Node._traverse() (and possibly remove recently added list() wrapping to the others).
Sphinx in at least two places expects a list on return, then your change will lead to troubles in dependents that abuse the documented API. What is the best way to cope with that?
Dramatic speed improvement