Reading Mixed Serial If/Else ? ?

I have actually put this into setup, what I posted was in the loop since I was just testing it out. Prior to the board being configured the way I need nothing else can be done in this application so the wait time isn't an issue. Now after having moved this from void loop to void setup the commands actually started going out too fast and the shield wasn't even ready to get commands yet. I've had to add a delay in the beginning of setup since it was spitting the commands out and hitting the time out portion before the shield was even ready to accept commands sending it into an endless reset loop. Even with the delay added total time to load when I power on the arduino and shield is less then 2 seconds to have the shield fully configured and ready to use.

This is a far better option than what I have found in pretty much every other sketch I've looked at that just used delay between each line waiting long enough between commands that it should have accepted the command but never actually knowing if it was setup properly.

What I'm trying to do now is set the code up in a series of steps 1,2,3, 4 etc so that rather then resetting the board if one line fails I could redirect it to simply move back to the previous line. It starts up and sends commands 1,2,3 and errors on command 4, instead of starting over it's sent back to line 3 and resend's the command, if line line 3 also fails it's sent back to line 2 and then line 1. If line 1 failed it resets the board. While it may seem slow it would be safer to have the program never make it out of setup if the boards not configured correctly. So what I'm now trying to figure out how to do it and have it run some type of count for the number of times it tries to setup each line before just exiting into an empty loop that turns on a light to signal an issue with startup.