What happens if you change heartbeat to a larger value, like 200 or 500 (integer variable instead of byte). I suspect you are just flashing it too quickly for the eye to see. 50 counts at 1ms is flashing every 50ms on/50ms off, 10 times a second. That is too fast to see by eye.
Also, not sure if "reading" ledout pin will return a proper value, since the GPIO is defined as output. It may return the internal buffered value, not sure.
I would use a variable to define the LED state. Then when heartbeat >= value, just "not" the storage value like "led = not led". Then output the value as "ledout = led"