Romans 11:33: "Oh, the depth of the riches and wisdom and knowledge of God! How unsearchable are his judgements and how inscrutable his ways!"
Isaiah 38:17: "Behold, it was for my welfare that I had great bitterness; but in love you have delivered my life from the pit of destruction, for you have cast all my sins behind your back."
Romans 8:28: "And we know that for those who love God all things work together for good, for those who are called according to his purpose."
Jeremiah 29:11: "For I know the plans I have for you, declares the LORD, plans for welfare and not for evil, to give you a future and a hope."
+++
The text is public domain:
1 God moves in a mysterious wayHis wonders to perform;He plants His footsteps in the seaAnd rides upon the storm.2 Judge not the Lord by feeble sense,But trust Him for His grace;Behind a frowning providenceFaith sees a smiling face.3 His purposes will ripen fast,Unfolding ev'ry hour;The bud may have a bitter taste,But sweet will be the flow'r.4 Blind unbelief is sure to errAnd scan His work in vain;God is His own interpreter,And He will make it plain.5 You fearful saints, fresh courage take;The clouds you so much dreadAre big with mercy and will breakIn blessings on your head.
+++
Romans 11:33 (particularly "how inscrutable his ways") appears in the first two lines: "God moves in a mysterious way / His wonders to perform."
Isaiah 38:17 seems to appear in the third verse; the hymn uses a similar description ("a bitter taste").
Romans 8:28 and Jeremiah 29:11 seem to be combined in the second half of the second verse ("Behind a frowning providence / Faith sees a smiling face") and the entirety of the fifth verse.