Deja Vu all over again. I've seen this question about 100 times over the years.
Quick and dirty answer. If you're talking to or seeing someone while you're broken up, and ignore that other person when you're back together; that's not cheating. Its not anything.
Frankly you're not married to your boyfriend at all and so if you broke up, where is there written anywhere that you have to be faithful to someone you're no longer seeing. Nowhere.
Second and more importantly, have you ever considered the hurt and pain you put on this other guy? I mean the reason why he's threatening to tell your boyfriend about your online flirting is because you led the other guy on. That's just plain unfair! So now he feels used and kicked to the curb. So he wants to hurt you to make you feel his pain.
If you want to date someone new, then don't lead them on and use them, only to throw them away when you're love of your life comes back. That's rude and immature. Its also hurtful and misleading.
You were dealing with another human being, not a computer. And when you use people for emotional support and then throw them away when you think you don't need them anymore; then you're being selfish and hurtful to the other person, and you're showing a complete lack of respect for their feelings as a human being.
Frankly, you're feeling "guilty" and so you want to get rid of this other guy so you can relieve the pain of YOUR guilt, not the pain you inflicted on your druggie boyfriend. He deserves the pain for being a druggie and forgetting about his girlfriend's and child's needs and thinking of his own selfish wants (not needs) that is drugs.
I would suggest that you think about this other guy and start apologizing to him for hurting him. Then ask him kindly to not hurt your boyfriend by threatening to contact him as you've told your boyfriend about your online affair.
And maybe, try being good to that guy, the one you hurt. He didn't do anything but support you when you needed him. What did you do? Dump him.
Finally, might I make a suggestion. If your boyfriend keeps lying about drug use, maybe that's a sign to let him go finally and tell him to hit the bricks.
I hate to say this, but your boyfriend uses you, and you use someone else. Then its a vicious cycle and the other guy is the first you run to when trouble comes up, and the first one to be dumped when the trouble disappears.
People who use drugs are immature and selfish. You probably see that in your boyfriend; and your boyfriend has a lot to do with your philandering on line with other guys.
Obviously this other guy got hurt because your boyfriend couldn't control his drug habit, was selfish, and used you. And now the other guy's been hurt a third time. Have you ever thought about what you did to that guy?
Think about it. Next time you break up with your boyfriend, I would suggest that you make it permanent and not ask anyone else to invest in you emotionally for their sake. Be fair to the people you flirt with. Don't sell false hope. Its cruel especially if that guy was lonely and needed companionship.