Job did not think like that. If he was self-righteous, why did he say to God:
(Job 42:6) Therefore I abhor myself, And repent in dust and ashes."
He certainly believed he would see God in heaven, but not through his own goodness. He needed a Redeemer:
(Job 19:25) For I know that my Redeemer lives, And He shall stand at last on the earth;
(Job 19:26) And after my skin is destroyed, this I know, That in my flesh I shall see God,
(Job 19:27) Whom I shall see for myself, And my eyes shall behold, and not another. How my heart yearns within me!
Acknowledging the need for a Redeemer, and repenting in dust and ashes, do not speak of pride, but humility.
Job 19 v 25-27a I know that my Redeemer lives, and in the end He will stand upon the earth. Even after my skin has been destroyed, yet in my flesh I will see God. I will see Him for myself; my eyes will behold Him, and not as a stranger.