The main problem here is that you're somehow misdirecting a radius search to give you something other than a sphere. Is this all the code being tested in that picture?
checkMiningBlock is being used in there as well
function checkMiningBlock(%position,%spawn)
{
%xpos = getWord(%position,0);
%ypos = getWord(%position,1);
%zpos = getWord(%position,2);
//left and right blocks
%position[0] = %xpos + 2 SPC %ypos SPC %zpos;
%position[1] = %xpos - 2 SPC %ypos SPC %zpos;
//front and behind blocks
%position[2] = %xpos SPC %ypos + 2 SPC %zpos;
%position[3] = %xpos SPC %ypos - 2 SPC %zpos;
//above and below blocks
%position[4] = %xpos SPC %ypos SPC %zpos + 2;
%position[5] = %xpos SPC %ypos SPC %zpos - 2;
for(%i=0;%i<6;%i++)
{
if(!$Mining::Block[%position[%i]])
{
if(%zpos <= 50000)
{
if(getRandom(0,mCeil(%zpos/180)+4) == 5) { %type = 5; }
}
if(getRandom(1,12) == 3) { %type = 2; } else if(%type != 5) { %type = 1; }
if(getRandom(0,1850) == 5) { %type = 6; }
if(getRandom(0,2250) == 5) { %type = 8; }
if(!%spawn) { placeMiningBlock(%position[%i],%type); } else { placeMiningBlock(%position[%i],1); }
}
}
}