I don't see why you are reading from serial in 2 different places in the code. What is the purpose of the sensorstring and inputstring variables ?
I would have thought that you would have done something like this
start of loop
if serial data available
read input and add to string until '\r'
print the data
end of if
wait for 5 seconds
end of loop
This would loop until data is available, read it, print it, wait 5 seconds then do it all again. If you need to do anything else in the loop function then you will need to use millis() to do your timing.