When I add something after set-motors(0,0)
if (sensorValue= analogRead(A5) < 500)
So, analogRead() is called to read the value of A5. That value is compared to 500. The result of that comparison, true or false, is assigned to sensorValue. If the value read from the analog pin is greater than 500, the block will be skipped, and nothing will be printed. Is that what you want? Printing true or false seems silly, to me.
Operator precedence rules need to be studied, or parentheses need to be added to override them.