How can I modify this opamp circuit's logic
How can I modify this circuit to make the output follows the input for
  inputs lower than the threshold?


Use an analogue switch and a comparator. 

When the comparator detects that the input voltage has risen above a "threshold" then it activates the analogue switch so that instead of it connecting its output to the input voltage, it connects its output to a reference voltage (called the set-voltage in the question): -