Bored is a special word in hypnotherapy. When a client says to me "I [do something] when I am bored" this immediately sets off a warning signal in my mind. Then I know I am dealing with a case of anxiety.
Boredom is better defined as a lack of stimulation. When you lack stimulation one of two things happens. You either get up and seek external stimulation, or you allow your inner thoughts to come out. Both of these alternatives have good and bad aspects.
Seeking external stimulation is least bad of the outcomes. Some people get motivated to do useful things. Others just go aimlessly looking for something, anything, to do. The old saying 'the devil finds work for idle hands' applies here. Much petty crime is the result of too much time and not enough planned activity.
Allowing inner thoughts to intrude also has several outcomes. Some client are so afraid of their inner thoughts that they spend their life in frantic activity, keeping busy all the time. Other people so hate the thoughts that they play music all day and keep the radio on all night. Having an external noise drowns out the the disturbing internal thoughts.
Most people do not go to such extremes. But the fact that they are having these thoughts is disturbing, and makes them feel anxious. So they do something to fill the void. When things get quiet is often when people start on their bad habits. Snacking is a classic response to boredom. Smoking is another. As is hair pulling.
So when the client tells me that they do it when they are bored, I start seeking the cause of their anxiety. Fix that and you fix the behavior.