Sorry but your simple recursive solution won't work mainly because of loops in recipes. Go deeper into the code if you want to understand why, or try to code by yourself. I cannot go further here. But believe me, the problem is more complex.As a possible solution or just yet another idea about pricing (pseudocode):
The API do not provide ways to detect hidden groups yet. So all groups are shown. But there is a solution, so I will work on this.Btw, in my previous last screenshot hidden groups still present in BM GUI, or i miss something?