This would take a bit of work to do in the code, but it turns out to be dead simple to accomplish with CSS. You still can't insert the separator "under" the last subcat in a set, but you can give a margin-top (or whatever you want) only to categories that follow a set of subcats. (You can use
border-top: 1px solid #aabbcc;
to put a divider in this location.)
This will give the extra space only to top categories that follow subcats:
Code:
#categories ul+li.cat-top {margin-top: 2.0em;}
This will give the extra space to any level category that follows subcats:
Code:
#categories ul+li {margin-top: 2.0em;}
The only way you can have an <li> element directly following (not just inside) a <ul> element is for there to be a list of subcats just ahead of it.
Note that this will not work for IE6 because it does not understand the "adjacent selectors" relationship. If you can live with people using this out-of-date browser not seeing the full esthetic effect of your design, you're golden.