And, just so we have our terminology straight, summary judgment is actually different from the motion-to-dismiss phase I was describing. In super simple terms, the latter happens after the parties have has the chance to gather evidence and seeks to determine whether it is legally possible for a party to win at trial. Therefore it occurs late in litigation, after parties have already spent a lot of money (but still before trial). The former typically occurs before evidence is even gathered to determine whether the plaintiff could legally win even if all of his or her allegations were factually true.
As for the threshold fee-shifting idea: I think it's probably not a good one. There are cases where it could help, but if the judge gets her threshold determination wrong, then it makes life even harder for a less wealthy litigant. The simplest solution, which many countries have implemented, is simply a loser pays system for legal fees. I'm not sure this is ideal either, but I think it is at least better.
There also is usually a possibility that the judge could require the loser to pay after the fact, if she determines that the case was especially un-meritorious. Another possible reform would be to loosen the standard that judges apply in choosing whether to award fees in this way.