Here is some sample javascript code. In the below sample code one line is added after the 4th field
<script type="text/javascript">
jQuery(document).ready(function(){
var class_name = 1;
jQuery("li").each(function(){
jQuery(this).addClass("class"+class_name);
class_name ++;
});
jQuery('.class4').after('<li><strong>Subheading</strong></li>');
});
</script>