I am still not clear which rules you want to apply, but got the general idea.
The possible solution would be to define a rule (on the root folder) that will be triggered only if name of item match ('Dir#'), and execute a custom script that will set rules on matched items.
It will not allow to change the rules later, except by writing another script, that will iterate through the tree.
If your subitems in a Dir# have naming convention, that includes #, you can get away with centrally defined rules. You may rename items on first import, using a script.