You can use xattr to write various metadata related to the "new" tags in Mavericks. John Siracusa did the heavily lifting already here.
Essentially you need to write two attributes, com.apple.FinderInfo and com.apple.metadata:_kMDItemUserTags, to the files. The easiest way is going to be to get a file tagged how you want and just copy the attributes from it. Open up terminal and change to the directory containing the folder you want to tag recursively. Then enter:
That will open up Finder so you can tag the sampleFile how you want all the other files to be tagged. After you're done tagging, switch back to your terminal window and enter:
find yourDirName -type f | xargs xattr -wx com.apple.FinderInfo \
"`xattr -px sampleFile`"
find yourDirName -type f | xargs xattr -wx com.apple.metadata:_kMDItemUserTags \
"`xattr -px com.apple.metadata:_kMDItemUserTags sampleFile`"
That will recursively drill down and tag all the files in yourDirName as well as files in any subdirectories. You can leave the -type f argument off if you want to tag the subdirectories as well as the files.
Finally, you can change the
find yourDirName -type f
find yourDirName -iname "*.ext"
if you want to only tag certain file types/extensions.