I was tempted to say “no difference at all” but there is a slight difference, that I try to explain:
Auftreten would most probably mean, that something happens, that you did not expect at all. It just comes up from something that you didn't see upfront.
Eintreten is something you expected to happen, if special circumstances are met, that you most probably knew or could have known in advance.
Let’s take one of your examples (slightly modified):
Let’s say, a man is in the hospital.
In the first case he is a 25 year old man, and he is there because of a broken leg:
Während der Mann auf der Liege lag, trat plötzlich ein Herzstillstand auf.
- No one would have expected a heart attack in that case → auftreten
In the second case he is a 75 year old man, who was brought to hospital because of a previous heavy heart attack.
Während die Ärzte ihn noch behandelten trat plötzlich der (endgültige) Herzstillstand ein
- This was somehow expected, because of the story before → eintreten
But: I think that not a lot of German speaking people would really use these two words differently.