Well the first step is to write out the grammar for your script. How complicated you make this is up to you.
open and window are keywords
window <title> [,<position]
window has a title, and an optional position
open has an address or a URL
A simple line-oriented parser (one keyword and associated parameters per line) is simple enough to roll your own parser. But anything complex (say loops, block structure, variables, functions, ...) you'd probably be looking at lex and yacc (or flex and bison)