That's too bad... *kicks dirt*
I don't think it's a serious error, most likely an oversight, but I thought it would be a good opportunity to work through the debugging tools (although I've yet to solve it).
Part of what I found was the dn in "(substr dn 1 10)" seemed like it should be dwg, since dn only holds the strlen. So when we tried to get the first 10 characters, it bombed because the variable dn was only two characters ("16"). Let me know if that was correct - it made sense to me, but so does deja vu.
I changed that and got a little further, but now it seems to hiccup around the "(setq att (entnext att))" with "** Error: bad argument type: lentityp nil **", but I can't figure out why (but I'm working on it).
Btw, not too bad for not having anything to work with