To get past the doors, you need to press the two wall buttons and to quickly move through the doors before they close. If you play with the MagicEngine emulator, you will find that it is impossible with the keyboard arrows to move the hand cursor on screen fast enough from the movement arrows in the lower right corner to the wall buttons on the center of the screen. If you try that, the doors will close before you can get past them. The solution is to move your party without clicking on the movement arrows on screen: you can do that by pressing the CTRL key while using the keyboard arrows. In that way, you can move your party in the dungeon while the hand cursor is still in the center of the screen, ready to click on the wall buttons.