We read this verse with the advantage of the knowledge obtained in Joseph Smith’s vision of the celestial kingdom. It would appear that Abinadi has reference to those who have died without a knowledge of the gospel “who would have received it if they had been permitted to tarry” and would have done so with all their hearts.
The principle involved is that those in the world of spirits will be judged “according to men in the flesh” (1 Peter 4:6; D&C 137:7; D&C 138:10). Thus we know that those who do not have the opportunity to hear the gospel in this life will have that opportunity in the world to come.
Those who, according to the judgment of God, would have accepted the gospel in earth life if that opportunity had come to them (and again, according to the judgment of God, who would have done so with all their hearts-that is, endured in faith to the end), will be heirs of eternal life (see D&C 137:7-9; cf. 2 Nephi 9:26).