Can I make a flashable zip executing commands?
Find an empty flashable package somewhere; edit META-INF/com/google/android/updater-script and add delete_recursive("/path/to/your/directory"); to remove the directory in question.

(On second thought, is it really necessary to make a flashable zip for this single purpose? If your phone has TWRP recovery available, why not just use its built-in file manager?)