@johnmike Start by establishing a naming convention for your sample maps. For example all the drum ones could start with drums_, all the guitar would have guitars_, etc.
Then in your script you get all the sample maps in an array. Then you loop over the array and any that start with drums_ you put into a dedicated drums sample map array, any that start with guitar_ you put into a guitar sample maps array, etc.
Then you can use those arrays to populate your combo boxes or viewports or whatever UI elements you want to use.