yes, you are right. the set_textdomain call is cheap though, so I see no problem pushing it closer to the callsite. Whenever a coroutine sleeps, another one can grab another textdomain. When sleep() is not called, a coroutine cannot be interrupted and therefore not loose focus.
I just pushed a new lua_xgettext.py extractor into our branch that can deal with ngettext. Unless you run into problems or I forgot something I think you are all set to fix the translation issues in this branch now, right? If so, I will focus my attention on other things now - there are some unfinished branches that need attention.