If a person uses drugs to self-medicate for compulsive behaviors, then the effects of the substance can keep the symptoms under control. However, repeated, long-term use of any drug can lead to tolerance. As the body adapts to the foreign substance, its effects are not as noticeable.
When that happens, individuals will increase the dosage and the consumption frequency to get the same effects. Over time, the substances will lose its ability to control the compulsive symptoms entirely. Considering the already-present compulsive behavior, that is a dangerous slippery slope, as it will be difficult for people to maintain proper discipline and take the medication responsibly. Moreover, this approach will also make it increasingly harder for a person to get through proper treatment, both for substance abuse and compulsive behavior.