Strictly speaking, is dying in a state of grace all that is needed for salvation?
To rephrase the question:
If a person dies in the State of Grace are they headed for heaven?
A person who dies in a state of grace - yes is on the way to heaven and to the Resurrection of the Just at the second coming.
(we would not phrase things though that way …but I get what your seeking with that question… ).
(of course the normative way the person enters such a state is via faith in Jesus Christ - and being united to his death and resurrection in Baptism…or if they have lost that true life - God can return them to that state - ie via Confession or the grace of perfect contrition …).
So when St. Paul speaks of “working out our salvation” he is speaking of staying in grace or if one has sinned repenting and confessing to enter the state of grace again?
That would be working out your salvation…(one received salvation…and now one lives it …walks in love…etc).
Living the reality of our faith and baptism …our being disciples of Jesus.
If we should fall into a mortal sin -quickly turn back to Christ (via confession etc).
Pope Benedict XVI on the subjects of Faith and Works in St. Paul
Plus earlier one:
I really think that most people die in a state of sin, mortal sin. But I also really think that God can read our hearts and minds and hopefully give us a chance to repent before the final judgement.