In PA the diminshed capacity defense only applies to homicide charges and it is not a total defense. Even if successful, it only reduces the gradation of the homicide; it doesn't result in a not guilty verdict.
PA also doesn't recognize the irresistable impulse version of self-defense. Even if the law recognized that defense, it would only apply in the self-defense context, so you wouldn't be able to take advantage of it on a theft charge anyway.
You may be able to attack the intent element of the crime, but that would be very expensive and require expert testimony. I'm not sure that avoiding a summary offense conviction would be worth the cost of retaining an expert.
I'd discuss the case with a local attorney who can advise you of all of your options. There may be other potential resolutions here.
You seem to have enough mental capacity to ask a pertinent question on Avvo. That suggests that, whatever your mental issues might be, it's going to be very difficult to prove that you lack the mental capacity to commit retail theft under the statute.
Just about the only thing I can think of that might possibly work is convincing the court/jury that your mental state was such that you didn't actually know you had taken the item. That could go either way, but if the court believes you, it could serve as a defense. But "poor impulse control" is not a defense to any crime.
You'd be best served by getting in touch with a local criminal defense attorney. Retail theft charges have a way of snowballing.
This answer does not constitute legal advice and does not establish an attorney-client relationship.
I agree with my colleagues, it would be very difficult and ultimately too burdensome to win with that defense in this type of case.
The above answer is for information only; and does NOT constitute legal advice. This answer does not constitute, nor does it create, an attorney-client relationship between KaplunMarx, PLLC, Theodor Kapun and any receiver. The information provided on these pages is general only, and you should not act upon this information without consulting with a qualified attorney.