I think the loop should start at 0 and end with <ent_status(ent,0). of course in ent_getvertex the vertex number should be current_vert+1. or use a >= as loop end.
but the error reason is the line:
_tst = return_blue(ent,vector(c.x,c.y,c.z));
where you reach the max 32 temporary vector limit within a frame. you should use there simply c.v.x or c.x.
moreover in getpixel you should use x and z because contact uses DX coordinate system where y-z is swapped comparing to 3dgs coordinates.