You could throw in another val = analogRead(potpin) and val = map(val, 0,1023, 500, 5); right after it sets the LED pin high, that way the delay is now based on the new value. I guess you could add it in again after the LED pin is set low if you wanted even more precision.