Anyway, this uses much the same method as tag -m Red -d (and will similarly take a while) -- I'd be curious what number it returns there.
use scripting additions
use framework "Foundation"
my filesIn:(POSIX path of (path to home folder)) withTag:"Yellow"
on filesIn:posixPath withTag:theTag
set theURL to current application's class "NSURL"'s fileURLWithPath:posixPath
set fileManager to current application's NSFileManager's defaultManager()
set thePaths to current application's NSMutableArray's array()
set theEnumerator to fileManager's enumeratorAtURL:theURL includingPropertiesForKeys:{current application's NSURLTagNamesKey} options:((current application's NSDirectoryEnumerationSkipsPackageDescendants) + (current application's NSDirectoryEnumerationSkipsHiddenFiles as integer)) errorHandler:(missing value)
repeat
set aURL to theEnumerator's nextObject()
if aURL is missing value then exit repeat
set {theResult, theTags} to aURL's getResourceValue:(reference) forKey:(current application's NSURLTagNamesKey) |error|:(missing value)
if theResult as boolean and theTags is not missing value and (theTags's containsObject:theTag) then
thePaths's addObject:(aURL's |path|())
end if
end repeat
thePaths's sortUsingSelector:"localizedStandardCompare:"
return thePaths as list
end filesIn:withTag: