Yes, you can't specify variables in the panel definition. They can only be changed within a function. There's no need for 'pan_setpos' because you can directly modify the positon with 'PANEL*.pos_x/pos_y'...
Code:
var gridx[5] = {0,32,64,96,128};
var gridy[5] = {0,32,64,96,128}; // bla bla
BMAP* panel_bmap = "image.bmp";

void CreateGrid()
{
PANEL* p = pan_create("",1);
p.bmap = panel_bmap;
p.pos_x = gridx[0]; p.pos_y = gridy[0];
set(p,SHOW);
}


Of course, this is tedious, so let the computer do the work...
Code:
BMAP* bmp = "image.bmp";

void CreateGrid()
{
var i,j,size = 33; // tested with a 32x32 picture.

for(i=0; i<screen_size.x; i+=size)
{
	for(j=0; j<screen_size.y; j+=size)
	{
	PANEL* p = pan_create("",1);
	p.bmap = bmp;
	p.pos_x = i; p.pos_y = j;
	set(p,SHOW);
	}
}

}