Unfortunately I don't have a solution for handling arrays.
Sometimes I have formats that use a "combo" of hashes and filenames that obviously require a long operation like search the hash and replace with the filename.
The only work-around I found was to store hashes as binary or hex sequence (after all it has a fixed size) and filenames followed by a dividing character (like ';') in a memory file.
Not sure if that's what you want but an example script is http://aluigi.org/bms/new_sword_legends.bms
Even if in my tests the script was very fast, it looks like it's still very slow with about 300'000 filenames:https://www.zenhax.com/viewtopic.php?p=64017#p64017