long distance = (duration/2) / 29.1;
What value IS in distance? if you don't KNOW, why is the rest of that code in there? You can't use the value in a variable until you know that the value is reliable.
What, exactly, are you using pin 13 for? More precisely, how many things are you using pin 13 for? One is the correct answer, but not the one you should come up with.