To create the flashable cwm script you need to add the META-INF directory. To illustrate below, after copying the META-INF structure and the relevant binary 'update-binary', all is needed is, to create the script 'update-script' which will reside in the same place as the binary.
Suppose your working directory is like this
| +- com/
| + google/
| +- android/
| + update-binary
| + updater-script
Let's take the above as an example, and to go with the example, you want to add a file into the system/lib, this corresponds to the android filesystem used. So you could have 'etc' in the structure, 'usr' and so on.
The real meat is in the updater-script that has some functions which you will have to dig up, I enclose an example of a script that flashes a boot.img and replaces the system/lib/modules directory also
Here's an example of an updater-script:
ui_print("Welcome to MyFlashableCWM!");
mount("yaffs2", "MTD", "system", "/system");
//... NEED TO REPLACE WITH WHATEVER YOU WANT TO DO HERE
That script will print out a message via 'ui_print', the crucial aspect is the 'mount' command which can be a bit tricky, for data as in /data it would be this
mount("yaffs2", "MTD", "data" "/data");
The order of the mount is important, whatever gets mounted first, second and so on, would have to be unmounted in the reverse order, i.e. second mount, first mount.
Have a look in the CyanogenMod's repo, in there, you will see this directory bootable/recovery/edify, there's source in there that shows the instructions that are used for the 'updater-script'