This is Hebrew poetry at its finest. Unfortunately, we are forced to read it in a very different language, bathed in a completely alien intellectual tradition. Here it is enough to note that Hebrew focuses on the interplay of thoughts on multiple levels of consideration. Each page of Hebrew verse can be several meters thick with meaning.
Of primary note here is parallelism. There is a first line asserting some thought; the second line may echo the same thought in different words, or it may offer a contrast, perhaps the same idea reversed. In some cases, the lines following a statement will carry off the thought into implications that vary. Linear thought is almost absent; multiple branches and less-than-obvious connections are often given. In terms of this being a long-winded debate, a great many responses are not direct to our Western thinking. Instead, the answer to an assertion may come around from behind and answer from a different perspective. Sometimes it’s necessary to back up and rip out the underlying assumption. Western logic is feeble by comparison, left in the dust trying to grasp such broad thinking.
Job is likely a descendant of Abraham and the setting seems around the time Israel lived in Egypt. The description fits several locations, but most scholars prefer the notion he’s living somewhere between Damascus and Edom. Everyone in the narrative believes in the God of Israel, but from a time well before the Covenant of Moses. It would be reasonable that Job’s story was known to Jethro who would have shared it with Moses. The book is typically ascribed to Moses as editor.
Job is described to us as a powerful and wealthy sheikh. The man is quite pleasing to God, but is nevertheless smitten with great tragedy. We are permitted to know why, but Job is never told. Rather, Job is beset with shallow-minded and legalistic men who assert he must have sinned. Job knows better, but slips into blaming God on the basis of human justice. The answer offered by Elihu and confirmed by God is that we may never really understand why embracing God’s justice doesn’t always bring worldly justice. Why do the innocent suffer?
In typical Hebrew fashion, the real answer isn’t directly stated, but implied: In a sense, no one is innocent; at our best every human remains a sinner. Our fallen nature fully deserves every bad thing this existence can offer. Suffering is the default. In the face of God’s holiness, only His mercy keeps us from damnation on any level. Suffering is not about buying a good place in Heaven; the most it can do is make us despair of this life. The only thing left standing is the otherworldly viewpoint, that this life isn’t that important in the first place. God’s person defines justice; the scales of justice are not in this world. Job lacks a fully developed view of the afterlife, as is common with folks having only a Mesopotamian outlook. The bracketing narrative was added by someone at least as late as Moses with a far more advanced understanding.