I think this is possible, but my scripting abilities are a bit weak.
My library is organized so that the top level folder is "artistname _XXX", where XXX is a 2 OR 3 digit number always preceded by the underscore. This number represents my own genre code and is always at the end of that top level folder.
What I'm trying to do is write a script that would determine that genre code and then apply it to the genre tag for all MP3's within that folder (including any subfolders).
Anyone have any tips on getting there?