I looked at the postbox.js code and it's not terribly complex...
jQuery('.postbox h3').prepend('<a class="togbox">+</a> ');
This actually adds the togbox at runtime, so you don't need to put it in your code. You just need
<div class="postbox">
<h3>Section Name</h3>
<div class="inside">
...
</div>
</div>
Here's the jQuery code that sets up the click. When you click (on the h3 technically) it toggles the closed class of the parent div (the same div with the postbox class). If you don't have an h3 to match it doesn't work. (And if you need something other than an h3, just change the code).
jQuery('.postbox h3').click( function() {
jQuery(jQuery(this).parent().get(0)).toggleClass('closed');
save_postboxes_state(page); } );
The rest of the code just deals with saving the status of the postbox elements, via an AJAX call to a backend wp-admin/admin-ajax.php
But you'll need to also include page.js or at the very least do this:
jQuery(document).ready( function() {
add_postbox_toggles('page');
}
otherwise the toggles and, most importantly, the onClick callbacks, don't get added and nothing happens, since the code in postbox.js is inside that function add_postbox_toggles().
Alternately, and maybe much simpler, don't include the wp JavaScript files, just create your own js file and include it... or embed it if you prefer, since it's pretty short. (You'll need to also include jQuery of course).
jQuery(document).ready( function() {
jQuery('.postbox h3').prepend('<a class="togbox">+</a> ');
jQuery('.postbox h3').click( function() {
jQuery(jQuery(this).parent().get(0)).toggleClass('closed');
});
}
(This omits all the other functionality, including remembering the state of the postboxes, but keeps the style)