I'd suggest performing a check after each call to adjustlocalvars() -- iterating through the local variable list, and checking that the new locals have startpc's higher than the endpc's of any locals that share the same name.
(actually, now that I look at it, this suggestion may not be quite right. unless you edit registerlocalvar as well, active locals may have endpc values that just contained freshly allocated memory. but performing a post-compile check; basically by making a hacked copy of ldebug.c:findlocal, should be perfectly doable.)