Okay, quite a lot to cover here

.
Here's the
updater-script file that is included in the
testflash.zip file that I've attached to this post. The attached
testflash.zip file is a "normal" flashable .zip file--i.e., the
update-binary is a binary file and the
updater-script is an edify script that will be executed by the
update-binary.
Code:
ui_print("");
ui_print("okay, let's do this thing...");
ui_print("");
ui_print(" extracting the first file...");
package_extract_file("testfile1.txt", "/tmp/file1.txt");
ui_print("");
ui_print(" extracting the third file...");
package_extract_file("shellscript.sh", "/tmp/script.sh");
ui_print("");
ui_print(" setting permissions on the script file...");
set_metadata("/tmp/script.sh","uid", 0, "gid", 0, "mode", 0777);
ui_print("");
ui_print(" running busybox dd...");
run_program("/sbin/busybox","dd","if=/tmp/file1.txt","of=/tmp/file2.txt");
ui_print(" running the script...");
run_program("/sbin/sh","/tmp/script.sh");
ui_print("");
ui_print("all done!");
Inside the
testflash.zip file are two extra files:
shellscript.sh and
testfile1.txt. I added these two files to show how you can include "resources" (i.e., extra files) that you can install (
package_extract) into a location (
/tmp in this case).
You can see how I extracted the files from the
flashable .zip file and how they were installed, with new names, in the
/tmp folder.
Then, I used the
set_metadata expression to secure the shell script so it could later be executed.
Next, I used the
busybox dd command to make a copy of
/tmp/file1.txt to
/tmp/file2.txt.
Finally, I ran the shell script via the
run_program command in a fashion similar to how the
dd command was invoked.
Inside that shell script, you could do all kinds of stuff--i.e., the
busybox dd command for instance that we did yesterday, etc. or whatever floats your boat

.
In the shell script I provided, I just did some simple echo commands and redirected the output to a
/cache/logfile.txt file.
So, you've got lots of flexibility in creating a flashable .zip file that's really extended when you can also execute a shell script--without having to resort to having the
update-binary BE the shell script like we did before.
By the way: most of my troubles last night were because I had an outdated
update-binary that I was trying to use...you must have a proper
update-binary that's intended for and works for your device.
Also, make sure you don't have any carriage-return characters in your updater-script file.
~ ~ ~
Okay, here is the raw output of the
/tmp/recovery.log that's easier to show than a screen shot of my recovery screen.
Code:
ScaryAlien@LV-426 ~/hb/testflash
$ adb push testflash.zip /sdcard/
3361 KB/s (278847 bytes in 0.081s)
ScaryAlien@LV-426 ~/hb/testflash
$ adb shell tail -f /tmp/recovery.log
I:TWFunc::Set_Brightness: Setting brightness control to 5
I:TWFunc::Set_Brightness: Setting brightness control to 0
I:TWFunc::Set_Brightness: Setting brightness control to 255
I:Set overlay: ''
I:Set page: 'clear_vars'
I:Set page: 'install'
I:Set page: 'flash_confirm'
I:Set page: 'flash_zip'
I:operation_start: 'Flashing'
Installing '/sdcard/testflash.zip'...
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Zip does not contain SELinux file_contexts file in its root.
I:Legacy property environment initialized.
okay, let's do this thing...
extracting the first file...
extracting the third file...
setting permissions on the script file...
running busybox dd...
about to run program [/sbin/busybox] with 4 args
0+1 records in
0+1 records out
23 bytes (23B) copied, 0.000069 seconds, 325.5KB/s
about to run program [/sbin/sh] with 2 args
running the script...
-----------------------------------------------
hello from shellscript.sh (or /tmp/script.sh)!
see ya later :)
-----------------------------------------------
all done!
script succeeded: result was [all done!]I:Legacy property environment disabled.
Updating partition details...
I:Data backup size is 663MB, free: 12020MB.
I:Unable to mount '/usb-otg'
I:Actual block device: '', current file system: 'vfat'
...done
I:Set page: 'flash_done'
I:operation_end - status=0
Next is a annotated one where I show the output of the script that you would see on the recovery screen in
blue (the XF forum formatting is going to make the emoticons show up here because it's not surrounded in a code-block, but that's okay):
ScaryAlien@LV-426 ~/hb/testflash
$
adb push testflash.zip /sdcard/
3361 KB/s (278847 bytes in 0.081s)
ScaryAlien@LV-426 ~/hb/testflash
$
adb shell tail -f /tmp/recovery.log
I:TWFunc::Set_Brightness: Setting brightness control to 5
I:TWFunc::Set_Brightness: Setting brightness control to 0
I:TWFunc::Set_Brightness: Setting brightness control to 255
I:Set overlay: ''
I:Set page: 'clear_vars'
I:Set page: 'install'
I:Set page: 'flash_confirm'
I:Set page: 'flash_zip'
I

peration_start: 'Flashing'
Installing '/sdcard/testflash.zip'...
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Zip does not contain SELinux file_contexts file in its root.
I:Legacy property environment initialized.
okay, let's do this thing...
extracting the first file...
extracting the third file...
setting permissions on the script file...
running busybox dd...
about to run program [/sbin/busybox] with 4 args
0+1 records in
0+1 records out
23 bytes (23B) copied, 0.000069 seconds, 325.5KB/s
about to run program [/sbin/sh] with 2 args
running the script...
-----------------------------------------------
hello from shellscript.sh (or /tmp/script.sh)!
see ya later 
-----------------------------------------------
all done!
script succeeded: result was [all done!]I:Legacy property environment disabled.
Updating partition details...
I

ata backup size is 663MB, free: 12020MB.
I:Unable to mount '/usb-otg'
I:Actual block device: '', current file system: 'vfat'
...done
I:Set page: 'flash_done'
I

peration_end - status=0
Finally, here's the adb session where I explored the
/tmp and
/cache directories to show where everything ended-up and what the contents and results were (I didn't put this in a code block either so that I could use the color formatting to highlight some items):
ScaryAlien@LV-426 ~/hb/testflash
$ adb shell
~ # alias ll='ls -l'
~ # cd /tmp
/tmp # ll
-rw-rw-rw- root root 23 1970-01-01 04:23 file1.txt
-rw-rw-rw- root root 23 1970-01-01 04:23 file2.txt
-rw-rw-rw- root root 33757 1970-01-01 04:24 recovery.log
-rwxrwxrwx root root 277 1970-01-01 04:23 script.sh
-rwxr-xr-x root root 365632 1970-01-01 04:23 updater
/tmp # cd /cache
/cache # ll
drwx------ system system 1970-01-22 13:11 backup
-rw-rw-rw- root root 40 1970-01-01 04:23 logfile.txt
drwxrwx--- root root 1970-01-01 00:00 lost+found
drwxrwx--- system cache 1970-01-01 02:51 recovery
/cache # cat logfile.txt
logging a message to /cache/logfile.txt
/cache # cd /tmp
/tmp # cat file2.txt
Hi! I'm testfile #1 
/tmp # diff file1.txt file2.txt
/tmp # cat script.sh
#!/sbin/sh
echo "-----------------------------------------------"
echo "hello from shellscript.sh (or /tmp/script.sh)!"
echo
echo "logging a message to /cache/logfile.txt" >> /cache/logfile.txt
echo
echo "see ya later
"
echo "-----------------------------------------------"
/tmp # exit
ScaryAlien@LV-426 ~/hb/testflash
Finally, an excellent and current resource about Edify:
Cheers and I hope that helps!
Let me know if you have any questions.
edit: oh, if you want to flash this, be sure to replace/update the update-binary with the proper one for your device.