The polygon must be convex, to create more complicated shapes you need to use compound shapes containing more than one polyon, circle, or box. You must also not duplicate any points (first and last points in your example are the same)
The following set of points are convex and works
SetSpritePosition ( dum_spr_RWALL01_ID,0,0 )
SetSpriteShapePolygon( dum_spr_RWALL01_ID, 4, 0, 1.0, 49.0 )
SetSpriteShapePolygon( dum_spr_RWALL01_ID, 4, 1, 40.0, 40.0 )
SetSpriteShapePolygon( dum_spr_RWALL01_ID, 4, 2, 90.0, 50.0 )
//SetSpriteShapePolygon( dum_spr_RWALL01_ID, 5, 3, 65.0, 52.0 )
SetSpriteShapePolygon( dum_spr_RWALL01_ID, 4, 3, 37.0, 74.0 )
//SetSpriteShapePolygon( dum_spr_RWALL01_ID, 6, 5, 1.0, 49.0 )