How to theme the node edit form to group fields into collapsible containers?
I would recommend you to first try the Field Group module that provides the option to do that kind of grouping and many more options.