The habit loop stays intact, but the behavior is simply changed to something healthier. (Okay, okay, we can argue about how healthy candy is later, but you get the idea.) Since the habit loop is still there, this also makes it more likely that you will fall back into the old habit at some point in the future.