Re-use lookup code for `script replace`

Other methods were allowing the use of either
the file name or the file id, but not replace.
This should allow now changing an official
script without modifying the hash. Whether or
not this is a good idea is another matter.