Help with combining 2 sketches together.

I don't have a problem with pin 13. Im not trying to run anything on pin 13. I was just using that to try and see if it will work. I even tried on pin number 10. Which is not connected to anything. So we can forget about those pins. Even if dont try to send a signal out to any of the pins after the if statement and only try to print something to serial it wont print either. So my issue is not connection with the pins.

And paul the answer to your questions is yes I think so. Because if I dont add to the loop of the first sketch, which the line you asked about is in, then it all works great. So I think it passes that point with no issues.