How to programmatically create new file/folder in Drupal 7 files directory?
To create folders you can use file_prepare_directory and pass FILE_CREATE_DIRECTORY as second parameter like so:

$new_folder = 'public://newfolder/';
file_prepare_directory($new_folder, FILE_CREATE_DIRECTORY);