What can we do to prevent this from happening in the future? (preferably by making software patents go away).
If nothing else works, how about reductio ad absurdum. Let's go through recent sci-fi/academic literature, file patents for anything technologically feasible that has a high probability of hitting the marketplace in the next 5-10 years, and then troll away until Congress acts.