You know how sometimes you will get a muscle that will twitch? Sometimes for hours. Will the veins or arteries near the heart do this as well?
Veins and arteries don't "twitch", it sounds like an irregular heartbeat, contact your doctor to set up an echocardiogram.
I agree with michelle.--- Only a muscle "twitches"
They may want to do a 24 hour monitor of your heart too, which involves wearing a little box for a day.
If you do need a pacemaker it is not a very serious operation. My friend had it done in day surgery.
All this is conjecture because it may not even be your heart but something else, like stress. Only a doctor can tell you that.