For link cable emulation, what you could do is emulate both Game Boys on each DS.
That way, all of the information that is missing for the link cable session is the keys pressed on the other Game Boy, which is provided by the other DS. The link cable can then be emulated locally, as if the other Game Boy had sent what it needed to send given its global state and the keys pressed on it.
The link initialisation would be as follows:
1. Pause both GBs at the next vblank, collapse cached flags, etc.
2. Synchronise the ROM such that "GB B" on DS A gets a copy of the ROM on GB B on DS B. Similarly, synchronise the ROM such that "GB A" on DS B gets a copy of the ROM on GB A on DS A. This step may require memory allocations or the creation of a scratch file on both DSes, and may be helped by global hashes and block hashes to avoid sending an entire ROM. From this point on, each DS emulates both its own ROM (showing its progress on-screen) and the ROM of its link slave (hiding its progress on-screen).
3. Synchronise all other emulation variables such that "GB B" on DS A gets a copy of the state of GB B on DS B. Similarly, synchronise all other emulation variables such that "GB A" on DS B gets a copy of the state of DS A. This step could be implemented by writing a saved state and the SRAM in memory, then sending it to the other DS perhaps with compression. From this point on, each DS can see the progress of both its Game Boy and the other DS's Game Boy.
4. End link initialisation. Enter "link mode".
In link mode:
1. The controls pressed on GB A of DS A are sent to DS B at the beginning of each frame, so that DS B can be made aware of how GB A will advance for the frame, and vice-versa. Each DS waits for the other GB's keypresses, which can be encoded in one byte. Each DS ignores keypresses until its own Game Boy has emulated one frame, so as to keep the synchronisation (e.g. you can't press A and have it apply in the middle of a frame anymore, because the other Game Boy will never know).
2. Each DS also emulates a single frame of each Game Boy, given the controls pressed at the beginning of their respective frames. The control passes from one Game Boy to the other when a byte is sent on the cable, so that the other Game Boy can receive the byte that was just sent.
3. Show the screen and sound only for the Game Boy respective to each DS.
That way, the link cable emulation can simply be 1 byte per frame! Each Game Boy will advance correctly, given that it has the memory contents of the other at all times, so you can press A on one Game Boy then A on the other to trade a Pokémon (which the other Game Boy will know about, so it can send the right bytes on the pretend cable), or the arrow keys in Tetris to move a piece (which the other Game Boy can turn into the right data for the link cable).
I take no credit for this idea.