Generating Bootscripts

I was wondering how to create my own custom bootscripts and I found a post from Jason describing the use of mkimage and pointing to a basic script to use. I modified it to look like this:

[script starts:]

#!/bin/sh
cat <<EOF > normal.cmd
if fatload mmc 0 80300000 uImage.bin
then
  echo ***** Kernel: /dev/mmcblk0p1/uImage.bin *****
else
  echo ***** Kernel: /dev/mtd3 *****
  nand read 80300000 280000 400000
fi
if fatload mmc 0 81600000 ramdisk.gz
then
  echo ***** RootFS: /dev/mmcblk0p1/ramdisk.gz *****
  setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/ram0 rw ramdisk_size=32768 initrd=0x81600000,32M'
else
  echo ***** RootFS: /dev/mmcblk0p2 *****
  setenv bootargs 'console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootwait video=omapfb:mode:1920x1080@24'
fi
bootm 80300000
EOF
/home/rlc/beagle/angstrom-dev/staging/x86_64-linux/usr/bin/mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Execute uImage.bin' -d normal.cmd normal.scr
exit 0

[script ends]

I don't understand parts of the above. Is what I'm doing making sense?

Bob