A friend asked me about Galatians 5.1 with regard to my claim in the previous post that 'law of God' in Galatians refers primarily to Jewish Torah-keeping, especially circumcision. The question then is: why is Paul warning the Galatians (i.e. gentiles) about being enslaved again, if the enslavement was to 'works of the law' as defined above? They would not have previously been keepers of Jewish law, so what can Paul's warning mean, or should it cause us to re-consider whether perhaps Paul just means good works generally when he says 'works of the law' in Galatians? Below is my shot at an answer.
a) I don't think 'works of the law' only means Jewish identity markers for Paul in Galatians, but I do think that is the primary reference, with circumcision standing-in almost as a part-for-the-whole in places (no pun intended), with the entirety of the Torah in the background.
b) Part of why I think it is clear that what Paul has in mind by 'works of the law' is Torah-keeping is because in 3.17 he specifically says that the law came in 430 years after the promise to Abraham-- that is the Jewish Torah.
c) But getting to the primary question: In chapter 4.1-8 it seems to me that Paul is saying one of two things. Either, that under the law the Jews were children, and thus functionally like slaves. That is, they had the promise but they were under a tutor, not yet having the privileges of adulthood and thus not being able to exercise freedom.
Or, he's saying that they were under the law because they were children and thus enslaved to elementary principles. That is, they were immature and subject to becoming enslaved to sin, so the law came in as a tutor to guard them. Either way, the point would be that they, the Jews, were really in the same boat as the gentiles (i.e. Galatians) who Paul takes it for granted were slaves (i.e. to sin, things that are not gods, elementary principles, etc.).
So there is an anlogy between the bondage that the Galatians were under before they became Christians, and the bondage that they would be putting themselves into if they submitted to Jewish law-keeping now that the fullness of time has come. Thus they would be "submitting again to a yoke of slavery" (cf. 4.8-10).
Paul is not then saying 'do not submit again [to the works of the law which are] a yoke of slavery.' He is saying something more like, 'you previously were submitted to a yoke of slavery, namely false/non-gods (4.8), and if you accept circumcision and the Jewish Torah-keeping that these Judaizers are trying to foist on you on this side of the incarnation and after having received the Spirit by faith in Christ you will once again be submitting yourself to slavery, and in doing so subjecting yourself to the elementary principles to which you were formerly enslaved.'
The law was a tutor when Israel was young and enslaved to elementary principles, but now the fullness of time has arrived and God has poured out his Spirit setting Jew and gentile free to serve him according to the Law of Christ/the Spirit/Liberty. Thus, to return to these distinctively Jewish practices is to make oneself a slave--an adult who nevertheless is ruled over by a tutor and thus does not come into mature manhood.
That's my best shot at it right now at least. So I do think that Paul has in mind primarily the distinctively Jewish practices of Torah-keeping, but I don't think that 5.21 has to mean that the Galatians were previously enslaved to "works of the law." Rather, they were "enslaved to those that by nature are not gods" and to the "elementary principles," as were the Jews, but the Jews had the benefit of the law/tutor. However, if the Galatians now go back to the Jewish law they will, in doing so, become slaves again because they are rejecting the mystery that has been revealed and the fulfillment of the Jewish law which is Christ.
This makes sense of why Paul can turn right around in chapters 5 and 6 and strike such a strong note on the imperatives, even warning the Galatians that those who practice high-handed sins will not inherit the kingdom. It's not that he's talking out of the other side of his mouth. It's that he hasn't been speaking against works per se all along, but against rejecting Christ by going back to that which only pointed to him and has been fulfilled. Of course this isn't to deny that Paul opposes the idea of justification on the basis of one's own merits. He certainly does. But to me this makes the most sense of the argument and context of Galatians.