It's there to limit the peak current through the driver triac.   
In the datasheet for the [MOC3043][1] this is given as 1A. So for a 115V RMS line with a pk-pk of ~170V, a resistor of around 180 ohms is suitable. The 330 ohms given is more suited to a 240V line, but if it works okay for your application then fine - the resistor value also sets the turnon angle, and too high a value may prevent the power triac getting enough gate current to turn on fully.  


  [1]: http://www.datasheetcatalog.org/datasheet/motorola/MOC3042.pdf