There are two ways you can go with a Tetris like game. You can create an array to store the grid, use the array to remember which boxes are full or not, and you can use the grid to determine if the piece your trying to move can move or not. Or you can make an imaginary grid that's just noticeable to the user because each piece moves a specific number of pixels each time.
An imaginary grid:
` Create a box
ink rgb(0,255,0),0
box 0,0,20,80
get image 1,0,0,20,80,1
` Set the starting players coordinates
PlayerX=100
PlayerY=40
` Create a movement timer
Mtim=timer()
` Create a fall timer
Ftim=timer()
do
` Show the players piece
sprite 1,PlayerX,PlayerY,1
` Check if it's time to allow left/right movement of the players piece
if timer()>Mtim+100
` Check for right arrow and if it's not beyond the imaginary grid
if keystate(203) and PlayerX-20>100
` Decrease the players X coordinate (move left 20 pixels)
dec PlayerX,20
endif
` Check for left arrow and if it's not beyond the imaginary grid
if keystate(205) and PlayerX+20<520
` Increase the players X coordinate (move right 20 pixels)
inc PlayerX,20
endif
` Reset movement timer
MTim=timer()
endif
` Check if it's time to move the players piece down automatically
if timer()>Ftim+1000
` Increase the players Y coordinate (fall down 20 pixels)
inc PlayerY,20
` Rest fall timer
Ftim=timer()
endif
loop