I like the pharmacy answer the best. Once you blow through your scripts a few times then have to suffer from withdrawals for a few weeks before your refill, eventually you will have a good talk with yourself and weigh the benefit of having one week of fun then three weeks of wd's. Obviously this only applies to prescriptions, but the concept can be used across the board, its called self control and while many people suffer from the inability to ration their doc, hence the reason for this thread, sometimes you either have to be called out, or more likely call yourself out!
This is crazily oversimplified but the choice is solely yours, not the drug, not your environment, etc. Take control and responsibility for your actions and ration how you see fit, then stick to it. When and if you can't, then you're an addict. Im not speaking directly to the op when i say you or your, just using a general term, not trying to be an ass.