For the block,
NPC Code:
if(playerenters){
canbepushed;
}
if(x=buttonx&&y=buttony){
//make sure to replace buttonx/y with the x and y the button is on
set puzzlecomplete;
x = startingx;
y = startingy;
//make sure startingx/y are the co-ordinates that the block
//started on
}
For the door, wall, etc.
NPC Code:
if(playertouchsme&&puzzlecomplete){
hidelocal;
dontblocklocal;
}
A simple block puzzle!