Maybe it makes sense to introduce an abstract type here:
abstype PORTBval_t = int8
macdef PORTB_LEDON = $extval(PORTBval_t, "0xff")
macdef PORTB_LEDOFF = $extval(PORTBval_t, "0xff")
PORTB_get and PORTB_set can be implemented as templates:
extern
fun{} PORTB_get (): PORTBval_t
extern
fun{} PORTB_set (v: PORTBval_t): void
This will allow you to re-implement them for different chip models.