Yes I just saw this thanks.
If you want to leave the system "as is" and do this yourself, you can shut down X (assuming you need the memory/resources for your script) or if you have ample resources, simply press <CTRL> + <ALT> + <F1> to jump over to a non-x shell and CTRL+ALT+F2 to return to the desktop.
To shut down X, here's a crude script I put together to do so for Tiny:
#!/bin/sh
sudo killall wbar
sudo killall flwm
sudo killall Xvesa
sleep 1
sudo umount /tmp/tcloop/flwm
sudo umount /tmp/tcloop/wbar
sudo umount /tmp/tcloop/fltk-1.1.10
sudo umount /tmp/tcloop/Xvesa
sudo umount /tmp/tcloop/Xprogs
sudo umount /tmp/tcloop/Xlibs
Odds are I haven't covered all the bases as there's probably a cleaner way to do this, but for the need I have it works well.
Hope it helps!