Christianity teaches you should practice what you preach and there's many more examples to the above. As I said, they think someone is watching.
I will respond more to these quoted passages but just to say this.
The book of James talks about faith and works. Works as a result of faith not to save someone. In other words if you have faith and see someone hungry why wouldn't you help them?
The original discussion was about can you get to heaven or be saved by good works alone?
John 3:16 one of the most famous verses in the Bible:
16 For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
Romans 10:9-10
9 If you declare with your mouth, “Jesus is Lord,” and believe in your heart that God raised him from the dead, you will be saved. 10 For it is with your heart that you believe and are justified, and it is with your mouth that you profess your faith and are saved.
If you want an example of someone who was about to die but was saved look at one of the 2 crucified with Jesus. He literally couldn't do a good work as he was on a cross.
The message of the Bible is of grace. You can't earn eternal life or being saved it's a gift of God's grace if you believe. Paul addresses this in
Galatians.
Luke 23: 40-43
40 But the other criminal rebuked him. “Don’t you fear God,” he said, “since you are under the same sentence? 41 We are punished justly, for we are getting what our deeds deserve. But this man has done nothing wrong.”42 Then he said, “Jesus, remember me when you come into your kingdom. ” 43 Jesus answered him, “Truly I tell you, today you will be with me in paradise.”
More than happy to discuss this more or DM if you prefer.