Arduino starter kit problem with Project 12 (piezo) -knock lock

Why don't you use this tutorial instead so you don't have to deal with the box locked/unlocked problem
http://playground.arduino.cc/Code/ToneAC