So, the code is right ?
If it does what you want, yes. If not, no.
Break the problem down into pieces. Does the sensor detect a return pulse in a reasonable period of time? Does that time correlate in a meaningful way to distance? If the distance is reasonable, is your calculation of percent correct? If so, does the LED go on when the percent is less than 25? I'm not sure how percent can go over 100, so I can understand why the LED never goes off. You don't pour coffee until your cup is 100% full, do you? Why are you pumping the tank 100% full?