If I'm understanding your facts correctly, no.
It sounds like you were voluntarily intoxicated. That is, you got high and then committed some crimes. That's not really a defense for you. While you can attempt to show that you were so high that you didn't actually have the intent to steal, it's simply not going to work here. You clearly had the intent to steal (hiding it in your pants, purchasing other items, attempting to flee). You seem to be saying that you wouldn't have stolen but for the fact that you got high. That's just not a defense.
By the way, these facts sound very close to an "Estes robbery", which is basically a shoplift with the use of some force. If the case is charged as a simple shoplift, I would strongly urge you to consider accepting a disposition early in the prosecution (after consulting with an attorney, of course).
Any statements I make in these forums (fora?) should not be taken as direct legal advice, merely informed guidance. This is true due to the anonymous nature of this venue, and the incomplete information which is invariably provided by the questions. It is imperative that you consult directly with an attorney regarding your specific situation before acting on or relying on anything represented here. Period.
Here's a bit more on California's law on insanity: http://www.justia.com/criminal/docs/calcrim/3400/3450.html.
I don't think that will fly. However, if you are a user and actually want to quit, you could perhaps ask an outpatient drug treatment program (if the prosecution is considering jail time).