I have emailed this script to the address you registered with on this message board (gmail).
Note that this script is just a starting point -- you will certainly have to revise it for your own purposes. For example, it is setup for particular filenames, and for a 3-echo EPI sequence used here (3 volumes per TR), rather than for standard 1-echo EPI data.