It sounds like you want to have a structure a little like whats already in Roundcube for the Preferences, so you have Preferences and then you have the sub sections and then you see those options so I suggest you find an existing plugin which uses that sort of structure and work from there. My sauserprefs plugin uses that structure for example.