But nothing seems to change when I comment them out.
gpio_write(sensorAddress, ddrSensor, I2CregisterConfig); // Sensor Switches
sets up the DDR (Data direction register) for the pins to be inputs. The turn on default is an input so you might not notice if this is removed. However it should be included as good practice.
gpio_write(sensorAddress, ddrSensor, I2CregisterPolarity); // invert switch inputs so 1 = detected
If this is removed then a logic zero on the input of the chip will read as a logic zero through the device, with it a logic zero on the chip will read as a logic one.
gpio_write(sensorAddress, 0x0101, I2CregisterExpander); // Fast response
This responds to signal changes faster but uses more power. With out this there will be a slight lag before the change pin goes low. You wouldn't notice this unless you were measuring it or had a time critical application.
for all of these see the data sheet for full details.