It's a fairly straightforward change to make it sort by YYYY/YYYY-MM. Making it a folder action is either simple but inefficient or complicated and possibly efficient. I erred toward simple, but whenever you add something to the folder the script will enumerate the entire folder contents (not just the added items), and every file will get processed (including the ones that were already in the correct subfolders). The outcome is the same, but if the folder holds a ton of files it'll probably take a while just to process one file.
To use the script as a folder action, save the script below as a script (not app) and put it in the /Library/Scripts/Folder Action Scripts/ folder. Right-click on the folder you want auto-sorted and select the script from the list.
-- Begin script
on adding folder items to ThisFolder after receiving AddedItems
SortFiles(POSIX path of (ThisFolder))
end adding folder items to
on SortFiles(SortFolder)
set AppleScript's text item delimiters to return
set SortFolderContents to the text items of (do shell script "find '" & SortFolder & "' -type f")
set FolderMakeList to {}
repeat with ThisItem in SortFolderContents
set ThisFile to ThisItem as string
if ThisFile does not contain "/." then
tell application "Finder"
set DateString to text 1 thru 7 of ((creation date of ((POSIX file ThisFile) as alias)) as «class isot» as string)
set ThisFilesFolder to SortFolder & text 1 thru 4 of DateString & "/"
set ThisFilesSubfolder to ThisFilesFolder & text 1 thru 7 of DateString & "/"
end tell
if ThisFilesFolder is not in FolderMakeList then
try
do shell script ("mkdir '" & ThisFilesFolder & "'")
end try
set FolderMakeList to FolderMakeList & ThisFilesFolder
end if
if ThisFilesSubfolder is not in FolderMakeList then
try
do shell script ("mkdir '" & ThisFilesSubfolder & "'")
end try
set FolderMakeList to FolderMakeList & ThisFilesSubfolder
end if
try
do shell script ("mv '" & ThisFile & "' '" & ThisFilesSubfolder & "'")
end try
end if
end repeat
return FolderMakeList
end SortFiles
-- End script