You're trying to send both numbers and text as bytes (Serial.write transfers bytes to the serial port). Your sketch checks whether the value read from the sensor is within range and if not, it warns you with text, but to receive text you need to use Serial.print which transfers ASCII values. Then you'll have to assemble that text in Pd (I guess with [makefilename] or something, but have never tried it).
If you wanna use Serial.write (which I think is the way to go), you shouldn't send text, but only values. I've written two versions of your sketch, one checks if the distance value is within range, and if not, it zeros that value, else leaves it intact and writes it to the serial port. The other version splits the byte to two, in case the value exceeds 255 (no idea what that range is), as Serial.write transfers bytes and if you get a value higher than 255 (a full byte), Serial.write won't be able to transfer that and your value will wrap back to zero.
Also, you were trying to use a custom Arduino sketch with Pduino, which works only with Firmata. I've changed the Pd patch as well (for both versions). Check it out and let me know if it works.