Consider...
...what many scholars say regarding this James 2 passage, that because of the structure (and here referring to what they term an Inclusio), the interloper / questioner's words (James is presenting) cover more than just verse 18 but continue on through verse 19 (so that it is the interloper / questioner speaking about "the demons also believe and..."); so that James's next words (his response) to that interloper / questioner starts where it says, "wilt thou know, O vain man, that _______?" in v.20 [etc], which changes how one reads those following couple / few verses, as James responding to the interloper / questioner's words in two verses (not merely the one).
...what many scholars say regarding this James 2 passage, that because of the structure (and here referring to what they term an Inclusio), the interloper / questioner's words (James is presenting) cover more than just verse 18 but continue on through verse 19 (so that it is the interloper / questioner speaking about "the demons also believe and..."); so that James's next words (his response) to that interloper / questioner starts where it says, "wilt thou know, O vain man, that _______?" in v.20 [etc], which changes how one reads those following couple / few verses, as James responding to the interloper / questioner's words in two verses (not merely the one).
...my additional thoughts (and I must be brief here due to time constraints): later where it says in v.23 the combination of both "Abraham believed God, and it was imputed unto him for righteousness: AND HE WAS CALLED THE FRIEND OF GOD," note that he was "called the friend of God" by other humans... See this in 2Chron20:7. This, therefore is the "justified" reference in this James 2 passage: justified in the sight of other humans (they thus can "SEE" what is otherwise an "invisible" thing, so to speak).
2. James is getting at what the lifestyle of the Christian is to be.
He accepts that they are "married" to God (Ja 4 "adulteresses!")
He is calling them to repentance--to bear fruit in keeping with repentance.
It's very simple.
Abraham's justification before God / by God was not [held] "in question" (from God's perspective) for something like "30 years" between the time when that which Romans 4:2-4 speaks of (and James 2:23a "Abraham BELIEVED God...") and the time when he [much] later "offered Isaac... upon the altar" (James 2:21).
What I understand is that there is the justification that happens at the time we believe, but there is still a coming judgment at which only doers of good will be declared justified (Ro 2:6-16, etc). Paul doesn't say "if Gentiles do by nature the things contained in the Law", he says "when they do it", and he is referring to believing Gentiles ("they show the work of the Law written on the heart [reference to the New Covenant promise in, eg, Jer 31:31-34]... circumcised in the heart by the Spirit").
So, for instance, Paul says to the Corinthians, "purge out the old leaven, for you are unleavened"--that is, you can possess a spiritual birthright, but forfeit it, like Esau, through your sinfulness, as Paul says, "if you live after the flesh, you will die" (Ro 8:12).
I endeavor to believe all of Scripture, not just one doctrine here or there. I must believe all of it.