You're making a person's thoughts criminal by adding more years to a sentence for them.
We (you all) already do this. This is why we have parole reviews. People are released/detained based on the probability of recurrence all the time. Sentences are decided based directly on the assumed threat to society the individual poses.