I was kind of fiddling with part of your timer code and part of what I had and I was able to get all the timings, highs and lows at the right place but the beep with the sound command is really lowsy, instead of beep it goes brererererep!
Of course If I had an scope I might see other strange things!