I'm trying out another approach: attaching my automated selling script on the tail of the barter menu. It solves the merchant chest respawn problem, but has issues of its own: complex chain of events, blocking dialogues and magic effects. As of today, this approach seems workable, if not entirely reliable, but it introduces some confusing UI artefacts (it detects the barter menu in time only 9/10 of the time, even if you give it 10s of seconds to do so; scripts appear to be only partially active while the barter menu is open).