How to Navigate from a sub folder to Next or Previous sub folder?

Julianon's script here does something similar with its depth argument: