If polyphony is the limitation, instead of trying to create note overflow solution, you can instead just limit one device to certain instruments, and the other to the other instruments, sounds easier in my opinion to trying to program a microprocessor, or some desktop or mobile midi software for that matter, which could very well work the same.