Pin 13 doesnt have pwm capabilities...
Ah, but it's a little known bit of trivia that analogWrite() will work on non-pwm pins (for somewhat relaxed definitions of "work." It will write a HIGH for values of 128 and higher, and a LOW otherwise.)
I thought it was a particular clever solution for not having digitalWrite() work, BTW. Thinking outside the box and all that.