Did God duel satan and wreck Job while at it?
Not in the least
Job was a good guy and revered God. But he also feared that his sons sinned and cursed God. To atone for his sons, he engaged a mechanism: a burned offering for every son.
Fortunately for all of us, salvation comes through Jesus Christ and not from some kind of ritual. Unfortunately for Job, the crucifixion hadn't happened yet. All Job had to work with was the Law, which demands offerings, and so he offered. But 'by the works of the Law no flesh will be justified in His sight; for through the Law comes the knowledge of sin' — Romans 3:20.
And that automatically surrendered him to Satan and his nasty doings.
The good news of course is that 'God causes all things to work together for good to those who love God...' — Romans 8:28. And Job certainly loved God. Job didn't sin (1:22) but he also wasn't safe (as safety comes in Christ). It takes Job close to 40 chapters to understand that in addition to loving YHWH, he should realize that he hasn't got a clue of what is going on and what God is up to.
God patiently instructs mankind on life and how it works. But good behavior is not salvific.
The story of Job, however, flows seamlessly over into the discussion about the nature and consequences of sin. Sin is whatever makes a person deviate from perfection. How God manages the universe is hard to guess at, and also why some of us lose our children to violent people or natural forces. Why do some of us get cancer, plunge into insanity or bankruptcy or any kind of destructive temptation?
Has it all to do with God choosing the least of evils? The consequences of sin are inescapable, and sadly the consequences of our neighbor's sin may easily affect us.
Some of us die, and we don't know why. But we have the promise that God causes all things to work together for good to those who love God, to those who are called according to His purpose (Romans 8:28).
Read our article The Skinny on Sin.