Paul had for much of his life, like so many of his peers, believed that salvation came through the Law of Moses--that if he exerted himself to the extreme to obey the rules, that would earn his salvation.
One of Paul’s great discoveries in the process of his conversion was that he himself fell eternally short and was dependent upon the sacrifice Jesus made on his behalf (see Romans 3:23-24).
Paul, understanding these beliefs among his people, expended great efforts in his letters to correct this misunderstanding--salvation came not through the Law of Moses, but through Christ.
Some relevant experience as a parent
I have learned more about my Father in Heaven by being a parent myself than through just about anything else I’ve ever done (lest there be any misunderstanding, I fully acknowledge that I am a flawed, fallen, mortal parent).
I ask my children to do lots of things--clean up toys, set the table, help me with tasks around the house, etc. Some things they can do on their own; most require my help but I still ask them to contribute.
Why do I ask my children to do things? Is it to earn their keep? Do their chores somehow pay me back for putting food on the table and a roof over their head? Absolutely not. My 3 year old is not capable of paying back what I do for him. Then why ask him to do anything?
We live in such a transactional world that we often superimpose that characteristic upon God. God is not in the business of transaction, but of transformation.
I ask my children to do things for their benefit, not mine. In fact, most of the things I ask them to do I could do more quickly and efficiently myself if I didn’t ask them to participate. But I genuinely care about the people my children are becoming--I want them to develop and learn--I ask them to do things because of what it helps them to become.
I also ask my children to not do many things. Almost all of these rules are given for 2 reasons:
- To protect them from harm
- To prevent them from harming someone else
As noted in the OP, the same two patterns are found--on a far more perfect scale--in the commandments from God. He asks us to do things to help us develop, and He asks us not to do things to prevent harm. Nowhere in there is the idea that keeping the commandments “earns our keep”.
Life and Death
As noted in the OP, God gave commandments to protect the lives of His people. But God cares about far more than just the results in mortal life. “That your days may be long upon the land” is indeed a blessing promised by God. But that is nowhere close to the greatest blessing promised by God, who sees our potential and future not just in mortal life, but in eternity as well.
Nowhere in the New Testament does God rescind the principle that He gives blessings to the obedient. Paul knew that. But one of Paul’s great insights was that “that your days may be long upon the land” is something far short of God’s promise of eternal life. Paul realized that without the grace of God his own fate would be spiritual death (separation from God).
He could keep every rule in the Law of Moses and still be eternally hopeless. But since even devout Saul of Tarsus couldn’t keep every rule, the law served only to condemn him...save for the atonement performed by Jesus Christ.
Jesus explained the result of knowing the rules and not keeping them:
47 And that servant, which knew his lord’s will, and prepared not
himself, neither did according to his will, shall be beaten with many
48 But he that knew not, and did commit things worthy of
stripes, shall be beaten with few stripes. For unto whomsoever much is
given, of him shall be much required: and to whom men have committed
much, of him they will ask the more. (Luke 12:47-48)
Because Paul knew the rules and fell short of keeping them, that “brought death” (spiritual death). The Law of Moses undoubtedly preserved the lives of many Israelites, but it did not provide eternal life.
As a perfect parent, God gives rules to prevent harm to His children, and He gives rules to enable His children to become what He wants them to become. Without His guidance & the atoning sacrifice of Jesus, spiritual death would be the fate of us all.
The commandments do bring protection (often even to the preservation of people’s lives) when we keep them; they also bring condemnation when we do not.
So does this mean that even if we sin we will be forgiven if we believe in Jesus as our saviour?
Idle belief is insufficient--the necessary role of repentance in the plan is as alive today as it was when Peter declared:
Repent, and be baptized every one of you in the name of Jesus Christ
for the remission of sins, and ye shall receive the gift of the Holy
Ghost. (Acts 2:38)
God is not in the business of transaction, but of transformation:
he is like a refiner’s fire
[He shall] purge them as gold and silver
And they shall be mine, saith the Lord of hosts, in that day when I
make up my jewels (Malachi 3:2,3,17)
This is why He asks us to repent and make covenants (see my comments here, here, here, and here outlining why “grace” describes covenants). Not because our actions will pay for our sins or earn our keep, but because our inaction would limit the changes in us God offers. Those changes--that refinement--are the very purpose of the plan.