The example in the SDK helpfile is meant to be used in an external Visual Basic (or C#) application that is controlling XPression using the .NET API. It is not intended to be used via the internal scripting engine.
Here is an example script that would work in the OnOnline event. Assuming you have a material and apitexture shader created and already assigned to a quad in the scene.
dim mat as xpMaterial
dim apitexture as xpAPITextureShader
dim pen as xpPen
engine.GetMaterialByName("Material1", mat)
mat.GetShaderByName("APITexture", apitexture)
apitexture.Clear
pen = engine.CreatePen
pen.Size = 20
pen.SetColor(0,128, 255, 255)
apitexture.DrawEllipse(Pen, 30, 30, 400, 400)
#XPression