I don't think that you are the only one who has suffered issues/panic attacks (although this is the first I've heard of ongoing intense headaches) caused by using JWH products. I am not extremely familiar with JWH but I have smoked "Spice" containing JWH which sounds similar to what K2 is - I could be wrong. But as you may of may not know, the herb/plant matter itself in these spice/k2 blends is not that actual active ingredient (JWH). The JWH extract is typically sprinkled on or mixed into I believe damiana but it could be a different herb. From what I understand the extract itself is extremely potent, and because of shipping and production on a large scale due to the growing popularity of this stuff sometimes more extract can end up in what you thought would just be a normal sized hit; causing an extreme affect on the end user (panic attacks/confusion/headaches apparently).
So I believe that this is probably the cause of your original discomfort after your k2-sesh. Due to the similarity of the high from these RCs and marijuana (why people smoke it) I'm thinking that now when you smoke weed your body could be associating it with that unpleasant JWH experience. I agree you should take a break for a while from all drugs - a month if you can last it, try to exercise and diet well, definitely lots of water (dehydration is the cause of something like 90% of headaches) and try to keep a positive outlook on life. Avoid the things that increase your headaches. If your problem has gone away completely and you want to smoke some weed, start small - one-two hits. I hope it goes away man - good luck.