Two-tone alarm issues
R5 controls the current gain through the transistor path, which allows you to control the current through the 8 ohm resistor at the end via bjt gate current equations. 

If you were say, going to QUT and taking enb245. It would have been useful because the peizo speaker you have connected as that 8ohm resistor has a 250mW rating, so you can use R5 to limit the power delivered to the speaker.