Andy, it still doesn't work 
MSIE, you caught me 
Code:
<Header>
Script Feature Flags: 0x000000015
</Header>
<Events>
real rHue = 0
real rRed = 0
real rGrn = 0
real rBlu = 0
//Fill the layer with 50% Gray (note the proper American English spelling of 'grey')
SetColourRGB(0.5,0.5,0.5)
Wait: 0 EvType: Command CommandID: CID_ToolSelect ParamType: ToolID Value: { 4921 (Fill Tool ) }
Wait: 0 EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E65 (Opacity), 1.0 }
Wait: 0 EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E57 (Spread), 0.0 }
Wait: 0 EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E47 (Blend Mode), 1 }
Wait: 0 EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E58 (Antialias Edge ), 0 }
Wait: 0 EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E44 (Single Layer), 1 }
<StrokeEvent>
<StrokeHeader>
<EventPt> Wait: 0.000s Loc: (20, 20) Pr: 1 Ti: 1 Ro: 0 Rv: NO Iv: NO </EventPt>
</StrokeHeader>
Wait: 0.000s Loc: (20, 20) Pr: 1 Ti: 1 Ro: 0 Rv: NO Iv: NO
</StrokeEvent>
//Set foreground color to Red in order to test if Color Sampler works
MessageBox("switching foreground color to red")
SetColourRGB(1,0,0)
//Take a color sample of the gray background
MessageBox("Taking a color sample at (20,20); this should set the foreground color to gray.")
Wait: 0.000s EvType: Command CommandID: CID_ToolSelect ParamType: ToolID Value: { 4909 (Color Sampler) }
Wait: 0.000s EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E44 (Single Layer), 1 }
Wait: 0.000s EvType: Command CommandID: SetToolProperty ParamType: ToolProp Value: { 0x0B2D05E45 (With Lighting), 0 }
<StrokeEvent>
<StrokeHeader>
<EventPt> Wait: 0.000s Loc: (20, 20) Pr: 1 Ti: 1 Ro: 0 Rv: NO Iv: NO </EventPt>
</StrokeHeader>
Wait: 0.000s Loc: (20, 20) Pr: 1 Ti: 1 Ro: 0 Rv: NO Iv: NO
</StrokeEvent>
//Read and give feedback on foreground color... nargh! It's red!
rHue = ColourH(); rRed = ColourR(); rGrn = ColourG(); rBlu = ColourB()
MessageBox("Foreground color after using Color Sampler: Hue=%%rHue, R=%%rRed, G=%%rGrn, B=%%rBlu")
//