This following articles introduce some fundamental information about writing script in E-Basic.
SCRIPTING: Introducing E-Basic 
SCRIPTING: Logical Operators 
SCRIPTING: Flow Control 
SCRIPTING: Examples and Exercises 
More advanced information concerning programming may be found in SCRIPTING: Programming: Intermediate  and SCRIPTING: Programming: Advanced .
NOTE: Detailed information concerning scripting in E-Basic can be found in the E-Prime Command Reference (https://pstnet.com/ecr).
OVERVIEW: Extending Experiments with Script