I tested part of your PR related to this %n macro bug, it works perfectly, great work
The problem is it now behaves exactly like in classic, with the same issue: a new name is generated each time the letter is read. I'm not sure if it's easy to fix with current DFU implementation, but it's not a very important bug since the name is not used outside the letter. Btw, the only other quest which actually makes some use of the %n macro is K0C00Y06, however this one is really difficult to test as it is plagued with many bugs.