Psalm 19:7-8: "7 The law of the LORD is perfect, reviving the soul; the testimony of the LORD is sure, making wise the simple; 8 the precepts of the LORD are right, rejoicing the heart; the commandment of the LORD is pure, enlightening the eyes;"
Galatians 3:10-11: "10 For all who rely on works of the law are under a curse; for it is written, 'Cursed by everyone who does not abide by all things written in the Book of the Law, and do them.' 11 Now it is evident that no one is justified before God by the law, for 'The righteous shall live by faith.'"
Galatians 2:15-16: "15 We ourselves are Jews by birth and not Gentile sinners; 16 yet we know that a person is not justified by works of the law but through faith in Jesus Christ, so we also have believed in Christ Jesus, in order to be justified by faith in Christ and not by works of the law, because by works of the law no one will be justified.
Romans 5:6-11: "6 For while we were still weak, at the right time Christ died for the ungodly. 7 For one will scarcely die for a righteous person - though perhaps for a good person one would dare even to die - 8 but God shows his love for us in that while we were still sinners, Christ died for us. 9 Since, therefore, we have now been justified by his blood, much more shall we be saved by him from the wrath of God. 10 For if while we were enemies we were reconciled to God by the death of his Son, much more, now that we are reconciled, shall we be saved by his life. 11 More than that, we also rejoice in God through our Lord Jesus Christ, through whom we have now received reconciliation."
+++
The text is public domain:
The Law of God is good and wiseAnd sets His will before our eyes,Shows us the way of righteousness,And dooms to death when we transgress.
Its light of holiness impartsThe knowledge of our sinful heartsThat we may see our lost estateAnd turn from sin before too late.
To those who help in Christ have foundAnd would in works of love aboundIt shows what deeds are His delightAnd should be done as good and right.
But those who scornfully disdainGod's Law shall then in sin remain;Its terror in their ear resoundsAnd keeps their wickedness in bounds.
The Law is good; but since the fallIts holiness condemns us all;It dooms us for our sin to dieAnd has no pow'r to justify.
To Jesus we for refuge flee,Who from the curse has set us free,And humbly worship at His throne,Saved by His grace through faith alone.
+++
The first half of the first verse is drawn from Psalm 19:7-8. The rest of the hymn seems to come from the other passages that are cited, although it's difficult to pick out specific similarities. The clearest traces are in the last verse. "Who from the curse has set us free" refers to Romans 5:6-11 (although the word "curse" is from Galatians 3:10-11). Galatians 2:15-16 could be cited for "Saved by His grace through faith alone," although this line actually bears more resemblance to Ephesians 2:8: "For by grace you have been saved through faith. And this is not your own doing; it is the gift of God."