Managing and Assembling Lots of Little Files

I want to record hundreds of little sound files and then assemble subsets of them sequentially into bigger files according to logical templates. Can anyone suggest some software or even just a general approach on how to do that?

How about loading them into a sampler, then writing a script to convert the “logical templates” into midi notes. You can then play the midi notes in a sequencer and the sampler will output the corresponding audio files (which can be recorded into Audacity if you wish).