I solved Karl's problem* a different way, so once again, I'm afraid I may have reinvented "hackbind". Here's the code:
http://www.cs.cmu.edu/~jcreed/transfer/depsubst.elf
*an inductive proof of substitution for LF, in LF; experienced twelf-ninjas may wonder why you'd want to prove that inductively rather than trivially by HOAS, but the point is that this is a toy problem to prove a concept towards proving the same thing for LF in hereditary-substitution style where HOAS doesn't buy you a free substitution theorem
http://www.cs.cmu.edu/~jcreed/transfer/depsubst.elf
*an inductive proof of substitution for LF, in LF; experienced twelf-ninjas may wonder why you'd want to prove that inductively rather than trivially by HOAS, but the point is that this is a toy problem to prove a concept towards proving the same thing for LF in hereditary-substitution style where HOAS doesn't buy you a free substitution theorem