A couple of early thoughts...
I don't even know how this compiles (but it does). This isn't correct:
Serial.begin (9600), // Start the serial connection at 9600 baud
There's a space before the (9600) and a spurious comma afterwords and there is no terminating semicolon.
Also, why don't you use the built-in
shiftOut function? In your version you're unnecessarily setting the pinMode for the clock and data pins with every call. These only need to be set once in your setup() code.
I'm a little iffy on your shiftOut code and potential timing issues. For example you set the dataPin back to 0 immediately after raising the clock pin - with no delay. This leaves a very short window (only a few clock cycles) where a high data bit is actually represented with a high data pin. Depending on the device you're talking to this may be too short an interval to actually record as a high bit once the device "catches" the clock transition.
I think you'd have better luck using the tested and reliable built-in shitOut function.
Lastly, how do you know your code isn't running when the serial monitor isn't open? If it's because you're not getting data out through your shift register then the problem might be in that code. If you're using a Diecimila or Duemilanove (or clone of these), then opening the serial monitor will cause a reset of the chip. This may be what you're seeing rather then it "unsticking". Try putting some led blink logic in your loop() as a status indicator so you can tell that the code is actually running. This will help narrow down where the problem is.