I haven't read the whole script, but, I don't see why you launch a new bash process to execute eg "${UNPACKCMD}"
To tell the truth, I'm not sure why either. If I try to execute it directly without wrapping bash around it, I get this error:
$ packfox.sh
lzop: cannot use both `-c' and `-p'
Usage ...