Short Answer: It is a new thought, not a summary statement.
The Source of the Command in 5:12
The book of James was written "To the twelve tribes who are dispersed abroad" (1:1) and insists upon such things as looking "intently at the perfect law . . . not having become a forgetful hearer but an effectual doer" of that law. He insists that "whoever keeps the whole law and yet stumbles in one point, he has become guilty of all" (2:10) and then cites various commandments from the Decalogue as examples. While it is clear that James understood the Law in light of the New Covenant,2 we must not miss the emphasis on the Law in his letter.
More specifically, the book of James is largely built on Leviticus 19:12-18.1 This is most easily shown by setting the various statements of Leviticus 19:12-18 side-by-side with some of the key statements in the book of James:

It is clear that James wrote his letter with this portion of the Old Covenant Law in mind. (With that said, it is also clear that James adapted the Law to the particular situation his audience faced.3) James 5:12 was thus important for him to include, because (A) it is part of the Leviticus passage he was working from, and (B) it had relevance to his audience's situation.
The Placement of the Command in 5:12
James is considered one of the most difficult books to outline, which has led many to conclude that it had no intentional structure, and is more like a book of proverbs or a rambling sermon! I have a different perspective, and would organize it as follows. It is helpful to note at the outset that the conflict within fellowships between the "rich" and the "poor" is very central to James' message.
Cultivating God's perspective on going through hard times (1:2-18)
Going through hard things is good (1:2-4)
If you don't have that perspective, ask God for it (1:5-8)
Praise God for the hard things you go through (1:9-11)
You are blessed when you persevere through these things (1:12-18)
A warning to those who might disagree (1:19-27)
Watch your mouth -- and your emotions! (1:19-20)
Obey the word of God! (1:21-25)
True religion is not spouting off at the mouth, but spending time with those who are going through hard times (1:26-27)
Don't show favoritism toward the rich; love one another (2:1-13)
Do not show favoritism (2:1)
If you show favoritism you are being evil, not walking in God's ways, and are being stupid (2:2-7)
Love one another and thereby fulfill God's Law (2:8)
If you do not love one another you will be judged by the Law (2:9-13)
Don't think you can refuse to love because you are "saved by faith alone" (2:14-26)
Faith without works is dead (2:14-17)
Faith without works is useless (2:18-20)
A man is justified by works of faith, not by faith alone (2:21-26)
A warning to those who teach otherwise (3:1-18)
Be very careful about being a teacher (3:1)
A person's mouth gets them into a lot of trouble (3:2-6)
The mouth is an untamed, evil beast; it should not be this way (3:7-12)
True wisdom is evident by good fruit; not jealousy and strife (3:13-18)
Walk humbly by the Spirit, not in the boastful pride of the flesh (4:1-5:6)
Your divisions are a result of your fleshly lusts and jealousy (4:1-4)
Humble yourselves and walk in God's ways (4:5-10)
Don't speak pridefully against each other (4:11-12)
Don't speak pridefully about your own life either (4:13-17)
The fleshly pride of the rich will be their demise (5:1-6)
Closing instructions (5:7-20)
Patiently endure until the Lord's return (5:7-11)
Do not swear with any oath (5:12)
Pray earnestly in your times of hardship (5:13-18)
Encourage those who correct the straying sheep (5:19-20)
If this outline is correct, James 5:12 falls within the last section, which contains various closing instructions. This means (A) it is not part of James' main logical argument, and thus, (B) it is not necessary to expect that it be logically connected to the text immediately before (or after) it, aside from being some sort of closing instruction.
Conclusion
In light of its source and placement, James 5:12 seems to have been a "loose end" of sorts (like 5:19-20) which he wanted to include (due to its appearance in his source text and relevance to his audience), but which was not directly connected with his main flow of argumentation in the letter (which had to do with the treatment of the poor by the rich).
In light of its placement in the letter, only the subject matter of the immediate context can tell us whether it is connected. Since the subject changes from "patient endurance" to "don't swear with any oath" to "pray in your times of hardship" here, there isn't really good reason to think 5:12 is connected with the statement before or after it, and so we conclude that it is a distinct thought.
With that said, hopefully it is clear from the above discussion that (A) it is not a random thought by any means, and (B) it is not awkwardly placed, nor does its placement suggest that his letter had no structure.
1) Thanks to Dr. Walt Kaizer for his excellent explanation of this in Walter C. Kaiser, Jr., The Uses of the Old Testament in the New, (Chicago: Moody, 1985), p.223.
2) For example, James was also built upon Jesus' teachings in the Sermon on the Mount; cf. Virgil V. Porter Jr., "The Sermon on the Mount in the Book of James, Part 1," Bibliotheca Sacra 162:647 (July-September 2005):344-60; idem, "The Sermon on the Mount in the Book of James, Part 2," Bibliotheca Sacra 162:648 (October-December 2005):470-82.
3) For example, James does not explicitly reference Lev. 19:14, but he does address related issues by exhorting his readers to humility and caution in speech, acknowledging that we all stumble, guarding against fleshly elitism, etc.