What will a digital pin output if no value is written to it?

I'm trying to extend an Arduino project using shift registers and I'm trying to build it on the already existing code. The existing project is the repatcher Repatcher | Open Music Labs. I'm troubled with some part of the code, as it sets some digital pins to output, but doesn't write any value to them. This is the part of the code that troubles me:

for (char i = 2; i <= 7; i++) { // get digital values
    digitalWrite(i,LOW);
    pinMode(i,OUTPUT);
    delay(1);
    byte patch = 0;
    for (byte k = 8; k <= 13; k++) {
      patch |= (digitalRead(k) << (k - 8));
    }
    patch = (patch ^ 0xff) & 0x3f;
    pinMode(i,INPUT);
    digitalWrite(i,HIGH);
    buffer[j++] = patch;
  }

The digitalWrite(i, LOW); at the beginning of the for loop is to turn the pullup resistors of the pins off (they've all been set to input in the setup function), and at the end of the loop it switches each pin to input and turns the resistors on again. But in the middle of the loop it switches pins 2-7 one by one to output, but it doesn't write anything to them. Can someone explain what happens if you don't specify a value to an output pin?
I guess its state will be low, but then, what kind of result will any operation give on a series of low pins?

Here's the whole code, if it is more helpful.

byte buffer[19]; // data transfer buffer

void setup() {
  // set all digital pins to input with pullups on
  for (byte i = 2; i <= 13; i++) {
    pinMode(i,INPUT);
    digitalWrite(i,HIGH);
  }
  // start serial port at 38400 bps:
  Serial.begin(38400);
  while (Serial.read() != 0xab); // wait for turn on signal
}

void loop() {
  buffer[0] = 0xc0; // start character
  byte j = 1;
  for (char i = 5; i >= 0; i--) { // get analog values
    unsigned int mod = analogRead(i);
    buffer[j++] = mod & 0x007f;
    buffer[j++] = (mod >> 7) & 0x0007;
  }
  for (char i = 2; i <= 7; i++) { // get digital values
    digitalWrite(i,LOW);
    pinMode(i,OUTPUT);
    delay(1);
    byte patch = 0;
    for (byte k = 8; k <= 13; k++) {
      patch |= (digitalRead(k) << (k - 8));
    }
    patch = (patch ^ 0xff) & 0x3f;
    pinMode(i,INPUT);
    digitalWrite(i,HIGH);
    buffer[j++] = patch;
  }
  Serial.write(buffer, 19);
  if (Serial.read() == 0xba) { // if turn off signal recieved
    while (Serial.read() != 0xab); // idle till turn on recieved
  }
}

The idea is to connect a pin of the first group (2-7) with one of the second group (8-13) with a wire and Arduino will create a byte which will then be translated in Pure Data to specify a connection between two modules. It's a modular interface for music.

Hope what I say and ask is pretty clear...
Thanks

You may find this helpful:

Reading an OUTPUT

The first thing you might notice about that code snippet is that digitalRead() is used on a pin that is assumed to be an OUTPUT. So does that mean you can use the pin as an INPUT and OUTPUT at the same time? No. It actually turns out, when digitalRead() is called on an OUTPUT, you are reading the status of the a register called “PORTB” inside the ATmega microcontroller. PORTB contains the current state of the pin for pins 8-13. So when you call digitalWrite() you are actually writing to this register, which then enables a HIGH or LOW on the OUTPUT.

So this means if the pin is currently a HIGH, calling digitalRead() on the pin will return a HIGH. Obviously digitalRead() will return a LOW if the pin is currently set as a LOW.

So the answer is that digitalRead() will return either LOW or HIGH based on the state of the pin. Now the thing to do is to look at the source for pinMode() to see if it sets a default mode when you set the pin. But I'm having trouble finding the source.

This is based on my experience with a UNO:

The I/O pins default to inputs so setting them as inputs during setup seems redundant.

In input mode, writing HIGH and LOW to the pin enables and disables the internal pullup.

In output mode, writing HIGH and LOW to the pin sets the output state to HIGH and LOW.

When changing a pin from input to output, the state (HIGH/LOW) last written to the pin is preserved i.e. an input pin which has the pull-up enabled would default to HIGH when switched to output mode and one with the internal pull-up disabled would default to LOW when switched to output mode.

Similarly, an output pin which is HIGH will have the internal pull-up enabled when switched to input mode, and one which is set to LOW would have the internal pull-up disabled when switched to input mode.