The manual is your friend

The main function is the first function which is called in your program. The level_load instruction, loads - as it says - a level. When you compile your level with WED, it spits out a WMB file. This is a compiled level file. Now, assign in WED to your map file the script file you made.

You can execute in WED the current level with its script. If you type "-diag" into the commandline, a file called acklog.txt will be created where you can re-read all error messages if you didn't had the time.