Create new folder using editor scripts

Hi all, I’m trying to create an automatic duplicator using editor scripts. I managed to create a command function that duplicates individual files, but I wasn’t managed to duplicate a folder or even to create an empty folder that will contain my duplicated files.
Did anyone managed to create a new folder using an editor script by any chance?
Thanks a lot!

Linking to my answer in another thread: Changing gui's content using an editor script - #2 by britzl