Takes a tokenlist and creates the allocated list of script tokens in script->token, of length script->len. Unnecessary tokens are discarded, and LINE and WORD tokens are inserted as required. Also sets script->line to the line number of the first token