Make strict rules and never break them...but you should have done that way before you became an addict twice. Now, I'd recommend never doing it, since you have horrible will power. If you want to use heroin in the future, my idea would be to start off with something less addictive to heroin and see whether or not you can manage that responsibly. If you can, then slowly do something slightly more addictive. If you REALLY want to do heroin in the future, that would be my recommendation.
The good thing is you were able to quit twice, so if you want to give it one last go knowing that if you break the rules you're done, I'm all for it. I'd say the standard rule is use once every 3 days, never redosing, and never breaking this rule. If this rule is broken, even once, you're done for.
Good luck