Any text editor would be fine. You'll want to make it a shell script by adding
#!/bin/bash
as the very first line.
Then paste the contents uelsk8s gave you. Save the file, and rename from .txt to .sh
It should look like this:
#!/bin/bash
cd /usr/src/build-kernel-22.19
VER=2.6.22.19
KERNEL=linux-$VER
CURDIR=$(pwd)
TMP=/usr/src
K=$(echo $TMP/$KERNEL | sed -r s/'\/'/'\\\\\/'/g)
cd $TMP
tar -xf $CURDIR/aufs.tar.bz2
tar -xf $CURDIR/squashfs3.3.tar.gz
mkdir lzma449
tar -C lzma449 -xf $CURDIR/lzma449.tar.bz2
tar -xf $CURDIR/patches/squashfs/sqlzma.tar.bz2
patch -p0 < $TMP/sqlzma1-449.patch
patch -p0 < $TMP/sqlzma2k-3.3.patch
patch -p0 < $TMP/sqlzma2u-3.3.patch
cd $TMP/squashfs3.3/squashfs-tools
patch -p0 < $CURDIR/patches/squashfs/mksquashfs.quiet.patch
cd $TMP/$AUFS
cat local.mk \
| grep -v "^CONFIG_AUFS_DEBUG =" \
| grep -v "^CONFIG_AUFS_COMPAT =" \
| grep -v "^CONFIG_AUFS_BRANCH_MAX_127 =" \
| grep -v "^CONFIG_AUFS_HINOTIFY =" \
| grep -v "^CONFIG_AUFS_EXPORT =" \
| grep -v "^CONFIG_AUFS_AS_BRANCH =" \
| grep -v "^CONFIG_AUFS_DLGT =" \
| sed -r "s/KDIR = .*/KDIR = $K/" \
| sed "s/CONFIG_AUFS_BRANCH_MAX_1023 =/CONFIG_AUFS_BRANCH_MAX_1023 = y/" \
| sed "s/CONFIG_AUFS_KSIZE_PATCH =/CONFIG_AUFS_KSIZE_PATCH = y/" >Makefile
make
mkdir -p /lib/modules/2.6.22.19/kernel/fs/aufs/
cp $TMP/$AUFS/aufs.ko /lib/modules/2.6.22.19/kernel/fs/aufs/
cd $TMP
cat Makefile | sed -r "s/KDir = .*/KDir = $K/" \
| sed -r "s/SqFs = .*/SqFs = $K\/fs\/squashfs\//" \
| sed -r "s/C=1/C=0/" >Makefile2
cat Makefile2 >Makefile
make
mkdir -p /lib/modules/2.6.22.19/kernel/fs/squashfs/
cp $TMP/lzma449/C/Compress/Lzma/kmod/{un,sq}lzma.ko k/lib/modules/2.6.22.19/ernel/fs/squashfs/
cp $TMP/$KERNEL/fs/squashfs/squashfs.ko /lib/modules/2.6.22.19/kernel/fs/squashfs/
Save as "script.sh" or whatever-name.sh
Then open terminal and execute it like:
sh script.sh
I've added the new line for you, sobasically all you need to do is copy the entire code and paste

P.S.
I dont think you'll need to start over, just start the script, if that doesn't work, then maybe start over.