Name all the bricks over the book case 'doorClose', and the bricks for when it is open 'doorOpen'.
For the door closed:
onActivate -> NAMEDBRICK (doorOpen) -> dissapear 0
onActivate -> NAMEDBRICK (doorClose) -> dissapear -1
For the door open:
onActivate -> NAMEDBRICK (doorOpen) -> dissapear -1
onActivate -> NAMEDBRICK (doorClose) -> dissapear 0