So, if I have understood correctly, you want to check if the AT commands are successful instead of just closing your eyes and delaying.
You need to read the serial response from the SIM800 after each command and check that it is what you want, eg. "OK", "ERROR", etc. Note that you may need to handle a timeout situation where you don't receive a response in a reasonable amount of time.