Best Practice for Looping though nested lists

What would be the best practice for looping thought nested lists for a code where you are changing parameters etc in Revit. I have found a few useful nodes including Element.SetSubCategory from the Clockwork package that are written to take a single list and not a nested list. As inside the node in flattens the list into a single 2D array before doing into the python code.

I have seen some people propose to put the main code in a definition then call this per nested list, while others would add the nested listing logic into the definition itself. With both these options there needs to be a way to have the nested lists as variable lenghts for the different inputs if possible.

Taking the previously mentioned node the Input,
Element maybe a nested list
SubCategory maybe a nested list but only have one item per level vs the Element which might have multiple.
CutOrProject (Boolean) maybe nested or could be a single value for all where you don’t want to repeat lots of times.

This maybe possible using a Zip / dictionary logic i need to check.

This is another code i have found that i have been using that would be great to understand how to make work on nested lists. I see it already has dictionaries and using Zip so maybe it better to loop the whole definition than to write within current code