Alain,
Syntax Highlighting: you will need to write a language grammar for this, which, in some way, will help you validate the syntax (as it will not be correctly hilited when incorrect). But it might not be as trivial as it seems since you will need it to work within LaTeX source code. I guess you would need a mechanism like PHP/HTML coexistence…
Just some ideas to get started,
Daniel
here some ideas : validate syntax , syntactic distinctions , run gnuplot ( this is not a big problem..)