But what about the dirty tricks companies play, such as patenting a gene sequence?
I don't have a problem with that in and of itself, the problem is lack of clarity in the law. The point of patenting it is so they don't spend 13 years and millions and millions of dollars for me to then come along, copy what they did, and sell it and undercut them because I don't have to recoup all that R&D cost. This is the real reason they patent, but all the anti-GMO zealots claim they sue for cross-contamination or whatever, which is simply not true. But, there should be clarity in the law to make it explicit. Note that there are also a lot of hybrid patents, and were before GMOs too!
Or writing contracts that forbid farmers from harvesting seed, forcing them to buy new seed each time?
Such contracts were common practice even before GMOs with hybrids. And hardly anybody cares, because hardly any farmers save seed anyway, so that point is moot except for a very small minority. And, for that small minority, there are still A LOT of varieties they can purchase and save seed. Saving seed is very time and resource intensive, it's not just a matter of putting part of your harvest in a bucket, so it's cheaper for farmers to buy new seed, regardless of whether it's patent or contract encumbered, or GMO or conventional.
Or deliberately modifying the genome so the plants are fine with respect to food, but don't produce viable seeds
That's BS. Monsanto patented a "terminator gene" but never produced. As we see on /. all the time, there are all sorts of things patented that are never produced. So somebody at Monsanto had an idea, they patented that idea, and Monsanto never created it. Maybe they didn't create it for PR reason, or maybe it's because it simply wouldn't have been profitable. It costs a lot of money for R&D and for safety testing for a GMO (well over $100million for a single trait), and since farmers aren't saving seed anyway, what would be the point? It's also possible (this part is conjecture, I haven't actually asked a farmer about it) that wasn't even the motivation. A farmer who rotates crops, as many farmers do with corn and soy, doesn't want spilled seed from the previous crop to grow. If, for example, they plant corn and there's soy growing up from the last crop, they will have to apply atrizine to kill the soy, so a "terminator" seed might actually be desirable to the farmer.