We know for sure, as some historicians pointed out, that Nicholas was educated not to show his real feelings. They taught him to always look calm and without feelings. We know he had a very strong self control. Alexandra even moaned for this, saying her husband was not able to show his feeling "out of the bedroom", so not even really in letters (i'm quite sure i read this in The Fall of the R, but I will check the exact page this evening after work). In fact, if you compare Alexandra's and Nicholas' letters you celarly see how open and even too sweet she is and how controlloed is him, on the contrary.
This was to say that generally people who have too much control over their own emotions could end up having heart problems/cancer. Or, at least, this i s psychological theory (or better, pshycosomatic). But it's generally given for sure that heart attacks&heart problems came mainly from a moment of great stress (for Nicholas: the war) or of great control over feelings. Maybe more than 20 years of reign, and so stress & worries & a lifetime of feeling control took their toll on him that day.
As Andrea pointed out, it's interesting he did not have other attacks later; IMHO (but it's just my personal opinion) this is due to the fact he no longer had a country to worry for - he was not a good ruler, but one can deny he worked very hard & worried so much about it - and could live a freer life, even in captivity, than before, with a great deal of physical exercise & time for his family. In captivity, IMHO, Nicholas was less captive than ever.
In fact, all the Bolsheviks that knew him in the last periods wrote he seemed healthy in Zarkoje Selo/Tobolsk (Kobylinsky, Yakovlev, Pankratov) and happy to stay outside.
Only In Ipatev House he became sick again, because he was not allowed to use his physical strenght & had worries again (the children left in Tobolsk - Aleksej's crisis - suite people not allowed in, and so on, you perfectly know it.)
Ok, this was just my very personal analysis, feel free not to agree!