A couple of general comments on coding style:
pinMode(0, INPUT); // sets the digital pin as input
Comments that simply repeat what a statement does are at best unhelpful. Comments that say when a given bit of code is run ("we're entering bridge mode") or why you're doing something ("delay to allow XX to happen") are invaluable.
It's good practice to use a #define or constant definition to identify your pins rather than to embed the actual pin numbers throughout the code. Firstly because it's not obvious when you look at the code what pin you're dealing with, until you mentally look up the pin number; if you get it wrong anywhere, it won't be obvious. Secondly because when you define it in a central place it makes it safe and easy to change the pin number if you ever need to.
If you wanted, you could get away with using a single jumper that is present/absent to configure the mode, rather than using an extra pin and having two jumpers. To do this you'd enable the internal pull-up for the input, and then have the jumper pull it down by connecting to an output pin which was set LOW.