The person is not necessarily already dead.
For instance a lot of people who suffer with dementia will have moments of clarity, where they remember something very vividly, or they are able to talk and function normally, but then relapse into a demented state.
It could be the case that the demented person is basically living in the demented state all the time, but there is still consciousness, there is still acting and behaving, thoughts, memories, emotions and feelings, there just seems to be less and less ability to control them or observe them clearly.
My grandfather recently died of dementia, and he never really got to the state where he "wasn't there", completely. He would live a large portion of his life as "not there", but then there would be moments where he was there.
Furthermore he continued to fight and fight and fight, and all he really wanted to do was be out of that damn bed and up and functioning again, but his body and his brain didn't really allow that.
So there was still some element of "him" left. And I think when he came to some point where he wasn't so sick, where he was at some kind of peace in the nursing home where he was staying, that he had some clarity, acknowledged that he wouldn't really get out of that damn bed, and that he had said everything he needed to say, that's when he left.
All of the aggregates are there, form, feeling, perceptions, mental formations, consciousness. They just seem to be unraveled, confused, the mind going ehre and there, because of sickness.
You can still see the conditionality of it, more confused when sick and unrested and uncomfortable, less confused when better and rested and comfortable.
Essentially what it comes down to, is does that person want to die, or do they not?
Demented people are a lot of times just like the rest of us, they don't want to die, they don't want to leave their family and loved ones, they just want to get better, get over it and go on with their life.
The problem they encounter is they don't get to get better, or get over it, and go on, it just gets worse and worse and worse, until death is more preferable than to live in that kind of existence.
So to address the post, it is compassionate to try to provide and help and help bring ease to these people. It is not the place of the nurse to discern whether or not they should be in the nursing home, that is the place of the patient and the family representing them.
I would encourage you not to see them as insane people who are out of their minds, but people who are situated in their experience, just their experience is very deluded, delusional, demented. Trying to reduce that confusion as much as possible, and try to have them experience some moments of clarity is a very kind act. Each moment of clarity is precious, and gives that person some real opportunity to try to work some things out before they have to go, or to establish some peace in their hearts before they have to leave.
For the sake of our own practice, we should really use this opportunity we have, when we are clear headed most of the time, or can get clear headed, to really practice discipline of the mind, that way if we ever have to experience alzhiemers and dementia, at least to not suffer so greatly, and to be able to pass in peace.
I have no doubt that the mind comes to clarity upon death when the mind is established in wisdom, love and compassion, as there is nothing more fundamental to us. That love and compassion is undifferentiable from our mind at it's simplest, at it's basis. I hope all people with dementia or alzhiemers can accomplish resting in that mind so that they might have clarity in their last moments, and be able to pass in peace knowing no confusion.