This is not really possible in a general way, since syntax errors may result from processing incorrect or unexpected output from some computations.
Adding an explicit syntax check would require replicating a whole lot or code (and code that is not always very readable) which can lead to inconsistencies and other maintenance nightmares.
The best you can do with the current LAMMPS binary is to add a command like
timer timeout 0:00:00 every 1
to your input and thus avoid executing all “run” and “minimize” and similar commands.
you will still have all other commands executed that are run in between
I suggest you experiment with this and give us some feedback and perhaps we could add a command line file -check
that automates that.