give yourself a working bin directory, copy the script in there, and replace the directory names with surrogates.
in your .profile
ORIGINAL_PATH=${ORIGINAL_PATH:=$PATH}
PATH=$HOME/bin:${ORIGINAL_PATH}
export ORIGINAL_PATH
guarantees you always have a consistent PATH,
then at the command line:
$ mkdir $HOME/bin
$ cp {the script you need} $HOME/bin
$ pushd $HOME/bin
$ vi {the script}
changing the names of those unwriteable directories to something you can get at. so, you might:
$ pushd # might take you HOME, if not cd $HOME
$ mkdir sbox # your "sandbox"
$ pushd sbox
$ mkdir -p a/path/to/a/previously/unwriteable/ ...
this latter creates a directory:
$HOME/sbox/a/path/to/a/previously/unwriteable/
I've found it useful to use positional parameters, rather than cutting and pasting longwinded file paths. If you're going to use a name repeatedly, then do something like this:
$ set /DIR/Whichheld $HOME/sbox a/path/to/a/previously/unwriteable filename
$ echo $# $*
then this
$ cp $1/$3/$4 $2/$3/$4
takes care of one file. If you're needing a lot of copies:
$ from=$1/$3
$ to=$2/$3
$ pushd $from
$ cp * $to
$ popd
$ pushd $to
will copy all the files in FROM to TO...
and good luck.