You simply need to adjust SetShadowmapSize or SetShadowQuality or SetShadowOffset or play with a combination of them
Try simply adding after you create the light:
'Create a light
light:TLight=CreateSpotLight()
PositionEntity light,Vec3(2,2,-2)
RotateEntity light,Vec3(45,45,0)
SetShadowmapSize(light, 512)