Here's a maze game that uses color (look in the keyboard controls procedure) to prevent movement through walls. You could also use height instead (ph-ahead rather than pc-ahead), and there's also a block called "wall ahead" that detects if a wall or cliff is within 1 step ahead of you.
There's a bug in TNG 1.5 that makes the camera get really jittery if nothing is moving, so I added a "forward .0001" block into the forever block to fix that. It's detached in this version, but you can just put it back in if you need it.
--Daniel