As 4GS says it may be something quite simple and not actually connected to your heart. I used to have these awful stabbing pains in the heart region, it really felt like I was being stabbed. When I was having an 'attack' I couldn't move because of the awful pain, and this could go on for half an hour. It turned out to be neuralgia (which is a pain in a nerve). It's more common in the face, but I had it in my chest!
So please don't worry too much, it may not be your heart at all. I'm sure if your Doctor thought that you were about to die he would have had you admitted to hospital there and then.