You have to enter when the guard is heading towards the screen top.
Go right and hide behind wall in room to right.
Once the guard comes back down and goes left or down, go upscreen.
Hide in room on left corner of screen, behind the wall.
To get anything done, you will have to kill the guard.