Thanks. Both methods are far more elegant then the hack I've been working on. The difficulty with both is that I want to be able to change the counter value using the set message (eg set 5) and for it to proceed counting down and then up.
Panaiotis's autocount object has 'updown' and 'downup' counting modes, as well as various others. You can find it here: http://www.unm.edu/~panaioti/Max/ObjMenu.htm
Below is an 'autocountoid' abstraction that I made when autocount was not UB, and which also has an 'uppdownn' mode, ie. repeating the max and min before changing direction, which is useful for arpeggiators etc.
Iirc, the arguments are count mode, initial value, min, max, step and ms between ticks,