There are (apparently) two parts to your problem. The first is devising a set of rules that correctly describe grammatical permutations of words, regardless of meaning. This was the focus of generative theories of syntax at the outset (from 1955), and there are myriad theories that were formal enough that they could in principle be implemented in computer code. Certain trends in syntax have moved away from highly formal approaches, and those theories might be rather hard to implement on a machine. Head-driven Phrase Structure Grammar is a theory with a strong commitment to formalism and numerous practitioners are in the computational linguistic business. Accordingly, they devise systems that parse input strings and tell you if the string is accepted by the grammar. You can then feed the program a corpus, and it will tell you which sentences are rejected. The HPSG approach involves setting up complex data structures that allow you to compute what structures "help" can enter into, and what "run" can enter into. If you can do this much, you have solved maybe 30% of the problem.
Some aspects of meaning are pretty strong in the realm of what is grammatical or not, for example you don't use the future tense to describe an action that happened yesterday (*"I will buy a car yesterday"). This leads to the problem of "Colorless green ideas sleep furiously", where "colorless green" is a direct semantic contradiction, and "green ideas" (etc) contradict reality. To detect such problems, you have to encode lots of real-world knowledge into your system, so it's not entirely a linguistic problem.
When you say "He used to eat chicken", you might be tempted to conclude that this means he doesn't anymore. But you can say "He used to eat chicken, but nowadays he complains about the taste when he does". There are a lot of usage features about language that are not about cold, hard grammaticality and literal meaning. These sorts of pragmatic complications are pretty mushy and hard to "compute". There are also programs of research into computational semantics and pragmatics, which are not quite as advanced as computational syntax.
This assumes a rule-based system, which requires linguists who discern systems of rules and then turn them into corresponding code. An alternative approach which seems to work for some languages but not others is to throw a corpus of a billion examples at a general purpose statistical meat-grinder, but it doesn't encode linguistic rules. It doesn't work for languages that don't have billion-item corpora (most of the languages of the world).