Yes, earlier in v. 24, Jesus says whoever believes in me has everlasting life, but he is clear that his judgment is not based only on belief. Jesus explicitly says that the judgment to heaven or hell is based specifically on whether one has done good or evil. Here is another judgment which Jesus proclaims that only those who do the will of the Father enter the kingdom. This judgment specifically decides who goes to heaven, and who goes to hell. The context here is about gaining salvation, or losing one's soul.
Works are yet again intimately connected with eternal judgment.
For there is no respect of persons with God. We see that Paul is in full agreement with Jesus on what the basis for judgment God uses in determining the eternal destiny of people. Paul writes nothing about a merely legal fiction being the basis for salvation at this crucial juncture of God's judgment. Everyone's deeds will be judged, heaven for the faithful doers, and hell for the workers of evil. Only the doers of the law will be justified.