Well, a demo is a little beyond my time limits right now, sorry - but I have to admit it is tempting =]
Step one - make a map of four by four tiles - I suggest a room with a four by four floor.
By the door to the room have one square with no NPC on it.
On all other squares, have an NPC whose graphic is on part of your whole image.
So to make your NPCs, you would make an image in a file which was 128 by 128. You would want one 32 by 32 square of it to be the part you will "skip" for the open slot. Then, for each 32 by 32 square in the image, make a character. (IOW make a file named $square1.png size 96 wide by 128 high and fill it with the first square in your image.) Then when you have fifteen squares, but the NPCs randomly around on the board. (Perhaps it would be nicer if you put them on the board in order, and moved them around to mix them up just to make sure you had a puzzle which you knew could be solved! But that is a bit more involved.)
Now the tricky part. Each NPC needs to move away from player when the little cursor is on top of it and you use a certain button. So when you enter the room, change actor graphic to some kind of small cursor like a blinking dot or something. Make the player's graphic priority change to "above player" so it will float like a butterfly. I guess now that I am thinking about it you might as well just make all of your NPCs priority "below player" instead.
And the hardest part - which I cannot playtest for you - will be eventing the movement of the NPCs. When the player moves over them, and you use the action button (or whatever) it will need to activate the switch of the NPC who is located in the same square as the player. There are tutorials which explain how to run parallel processes to determine this.
Then the event beneath you has a move route of "move away from player."
And then there will need to be a common event which checks the NPCs after every move to see if they are now in the correct places, using the same method as the parallel process above.
I know this sounds awful to do if you are unfamiliar with eventing, but I have to admit that this is a creative new puzzle idea - one I have not heard anyone discuss before - and I think you should either ask someone to help you get it done by continuing to request a demo here or by learning the steps yourself.
Keep at it! Good luck with your game!