Yeah it does suck that this is such an addictive behavior. When you get the urge, just try to push it out of your head with other thoughts....a silly movie you've seen, a good meal you've had recently, actually focus on each and every dish, resavor the flavors, a good book you've read...things like that...try to make your mind focus in a totally different direction.
Is there anyway that you could just go to sleep? Do you have any meds that help you sleep? I know this isn't a permanent solution, but for really bad nights, until you get back with some help...it beats sitting up all night fighting with yourself.