Religion is full of 'get rich quick' schemes and this sounds like one of them; as though a person can spend their life not developing the mind then miraculously, before they die, they will miraculously cultivate an enlightened thought that saves them from an imagined damnation.
Last night, for the first ever, my mother was too scared to go to bed, thinking she was going to die if she went to sleep. That evening, she had some experiences of strong dizziness, due to obviously a worsening lung & carotid artery condition. I said to her death is peaceful & a rest from the sufferings of this life. She immediately went to & had a very good long night's sleep. Then, early this morning, I looked into her room to see her sleeping on her side; differently to her sleeping position on her back last night. When I returned home from my early morning swim, I looked into her room again (to check if she was still alive), to see her bed was neatly perfectly made. Then I walked into the kitchen and she was pottering around as usual; cooking; and then asked me if I had any clothes that needed washing.
When people are old and start to have diminished mental faculties, there is generally not much they can spiritually cultivate. If we cannot develop some Right Views in the prime of life, its unlikely it will be developed just before death, when the body & mind are weak or in a modern hospital stuffed with tubes & wires; mentally tranquilized on various medicines.
Obviously, if there is 'rebirth' or a 'day of judgment' (as found in other religions), as taught in the suttas (and in other religions), all of the life's kamma (including kamma that has resolved past bad kamma) will be taken into account.
For example, if my mother passes away deliriously with angry & frustrated thoughts about why doctors could not cure her at 87 years of age (which are irrational thoughts she sometimes has), this obviously would not mean she will be reborn as a demon. Obviously my mother continues to have the same maternal disposition she has had for most of her life; she still mostly enjoys performing benevolent actions for family & friends. Obviously, any resistance she has to death (which may cause anger & frustration) are due to her continuing desire to perform maternal actions. Therefore, obviously, if there is 'rebirth', my mother will be reborn with a maternal disposition rather than a demonic disposition.
Some suttas about disposition at the time of death include:
Monks, eleven advantages are to be expected from the release
(deliverance) of heart by familiarizing oneself with thoughts of
loving-kindness (metta), by the cultivation of loving-kindness, by
constantly increasing these thoughts, by regarding loving-kindness as
a vehicle (of expression), and also as something to be treasured, by
living in conformity with these thoughts, by putting these ideas into
practice, and by establishing them. What are the eleven? 1. "He sleeps
in comfort. 2. He awakes in comfort. 3. He sees no evil dreams. 4. He
is dear to human beings. 5. He is dear to non-human beings. 6. Devas
(gods) protect him. 7. Fire, poison, and sword cannot touch him. 8.
His mind can concentrate quickly. 9. His countenance is serene. 10. He
dies without being confused in mind. 11. If he fails to attain
arahantship (the highest sanctity) here and now, he will be reborn in
the brahma-world.
Have no fear, Mahanama! Have no fear! Your death will not be a bad
one, your demise will not be bad. If one's mind has long been nurtured
with conviction, nurtured with virtue, nurtured with learning,
nurtured with relinquishment, nurtured with discernment, then when the
body — endowed with form, composed of the four primary elements, born
from mother & father, nourished with rice & porridge, subject to
inconstancy, rubbing, pressing, dissolution & dispersion — is eaten
by crows, vultures, hawks, dogs, hyenas, or all sorts of creatures,
nevertheless the mind — long nurtured with conviction, nurtured with
virtue, learning, relinquishment, & discernment — rises upward and
separates out.
Mahanama, a discerning lay follower who is diseased, in pain, severely
ill should be reassured by another discerning lay follower with four
reassurances: 'Be reassured, friend, that you are [already] endowed with
verified confidence in the Awakened One... you have verified
confidence in the Dhamma... you have verified confidence in the
Sangha... you [already] have virtues appealing to the noble ones:
untorn, unbroken, unspotted, unsplattered, liberating, praised by the
wise, untarnished, leading to concentration.'
[The Blessed One said:] Brahman, there are those who, subject to
death, are afraid & in terror of death. And there are those who,
subject to death, are not afraid or in terror of death. And who is the
person who, subject to death, is afraid & in terror of death? There is
the case of the person who has not abandoned passion, desire,
fondness, thirst, fever & craving for sensuality. Then he comes down
with a serious disease. As he comes down with a serious disease, the
thought occurs to him, 'O, those beloved sensual pleasures will be
taken from me, and I will be taken from them!' He grieves & is
tormented, weeps, beats his breast, & grows delirious. This is a
person who, subject to death, is afraid & in terror of death.
It can be discerned, from merely the four quotes above, how the Dhamma and non-dhamma attitudes are cultivated throughout life; rather than at the last moment.
Therefore, while my mother (similar to AN 4.84) may still have attachment to sensuality, last night with a reassuring few words & touch, my mother slept peacefully, as though she had had enough dispassion of life and was ready to rest. Possibly she simply needed my approval to rest; because she still believes she has a duty/purpose to look after her children. I suppose i am saying when it comes the time to pass away, most people will have a dispassionate instinct to pass away; that even much of their religious indoctrination about past & futures lives will not even be in their mind.