not sure how to do it in shake but you could save the script, open it in your favorite text editor and grep through it...
for example:
SFileIn1 = SFileIn("/path/to/nameofthefile.#.tif",
"Auto", 0, 0, "v1.1", "0", "", 0);
SFileIn2 = SFileIn("/path/to/nameofanotherfile.#.tif",
"Auto", 0, 0, "v1.1", "0", "", 0);
SFileIn3 =....
so...
search for: "SFileIn"[anynumber]"("/path/to/"[anyname]"
replace with: "[namefromlastsearch]"[number]"("/path/to/"[name]"
i don't use grep enough to remember the exact syntax, the BBedit (and possibly textwrangler) manual has an excellent explanation, as do tons of websites.
i'm sure there are much more elegant ways to do this, but if you're stuck give it a try.
++ chris