You should be able to do this simply by changing the flag used in the CBL_DIR_SCAN_START from:
compute search-attributes =
find-file +
find-directory +
find-neither.
to
compute search-attributes =
find-directory
or you could check the flag on the CBL_DIR_SCAN_READ for the return value to check if it is a folder.