It’s not a question of whether the Psalmist is close to literal death, but that he faces an experience of death on a broader level. David could live without his crown, but was altogether worried that his situation signaled he had moved outside of God’s favor.
As noted previously, hyperbole is not deception. In Hebrew culture, the purpose of language to was to bring to life something the listener or reader did not personally experience. It was entirely appropriate and expected to address your superiors with dramatic exaggeration. Thus, David cries out to his God in deep exasperation. This amounts to a rhetorical question, asking how long the Lord would fail to respond to his cries.
Continuing in the same vein, he asks whether God has noticed that David languishes under the apparent victory of his enemies, with the obvious implication that these are also God’s enemies. Will the Lord allow these nasty people to get away with publicly tarnishing His name? David wails that it is just like dying for him to think God has no interest in His own reputation. David asks for a fresh moral vision of how God works in this fallen world.
Does God truly intend to let David end like this? Has David fought so hard and so long in the name of Jehovah only to fall at this critical moment? Will his enemies be the ones who celebrate their human power over God’s man?
Of course not. Despite the rhetoric, David does the right thing in calling out to God because it shows where he places his trust. It might be heart-pounding close, but David refuses to quit. God has never failed him. In a standard Hebrew parallelism, David asserts that he will praise God as God while he fights, and rejoice in God when he wins. He’s warming up the harp for that latter tune already.