Here is the final firmware. I chose the values of xVal, yVal, and zVal based on the output I saw from the code from step 3 when I had the +x direction pointed vertically up, and the -y direction pointed towards north and parallel to the ground. You might find that different values work better for you. When the incoming directional values from the compass module equal the values of xVal, yVal, and zVal, the Arduino turns the piezo buzzer on. The variable "tolerance" sets the sensitivity of the device, you may want to increase or decrease this depending on what you like.
The piezo buzzer automatically buzzes at ~1Hz. You can upload the code below if you want to hear the full buzzing potential of the buzzer.
I found this buzzing to be a bit much so I pulsed power on and off to the buzzer to quiet it a bit. See the code below: