There are in fact three very nice properties that characterize well-behaved "height functions", which are the things that tell you what to call a bound variable when you bind it.
Stepping back, the whole process I guess is like someone handing me a lambda term like
and my job is to come up with a canonical alpha-equivalent lambda-term --- according to one height function Pollack mentioned, (on page 8 of http://homepages.inf.ed.ac.uk/rpollack/export/SatoPollack09.pdf) it would come out:
where I'm using numbers as bound variables, but unlike deBruijn, they occur at binding positions too.
This labelling process I'm tasked with can be done in a very nice substitution-compatible way; for this particular height function, every occurrence of a subterm like \z.z will always become \1.1, every subterm like \x.\y.x will always be \1.\0.1, and so on.