The Airdrie & Shotts MSP said he had “experienced the National Health Service at its best”.
Mr Neil, who underwent surgery for a block artery after falling ill on January 26, said he would "soon be back to my old self" and was “feeling fine”.
Loading article content
He said he had not suffered any permanent damage to his heart.
Writing about the health scare in the Wishaw Press newspaper, the 65-year-old said: "I took my heart attack while working in the Scottish Parliament.
"Luckily I remembered from my days as Cabinet Secretary for health that getting medical attention in the first hour is the key to minimising the impact of such an event.
"An ambulance was there within a few minutes and in less than two hours I was in the coronary care unit at Edinburgh Royal Infirmary having already had a stent inserted to my heart to deal with the blocked artery and my situation stabilised with the help of medication."
He added: "I experienced the National Health Service at its best.
"The dedication and efficiency of the ambulance service paramedics along with the excellent care I got in Edinburgh Royal Infirmary were second to none.
"After only two nights in hospital, I got home and I am feeling fine."
Mr Neil's absence from politics has coincided with SNP HQ deselecting several of his allies on North Lanarkshire Council, as part of efforts to stop internal faction-fighting linked to the so-called Monklands McMafia feud.
Councillor Michael Coyle, Mr Neil's election agent and Holyrood case worker, was among those who failed vetting to stand for re-election for the SNP in May. He can now appeal the decision.