Just have a few functions implemented, same stuff that FCEUX provides:
emu.frameAdvance() (Would have to be called in the script's main loop)
emu.skipFrame()
memory.readByte(location)
memory.writeByte(location, value)
input.readPad(index)
input.writePad(index, value)
input.readTouch(index) (For getting native touches on the screen)
input.writeTouch(x, y, pressed) (For putting the single NDS touch on the screen)
Would make it possible to play games like Metroid Prime: Hunters with dual analog controls, way better than doing it with fake touch inputs through sendevent or something. Especially since in Hunters, the screen doesn't move for a few frames after you initially press on the screen to prevent accidental movement with the stylus, and your fake touches from the second analog stick going off screen, that means that your aim would stall frequently.
We could override all of that stuff that would be bad with dual analog controls by just writing directly to memory.. I'm not 100% with how complex NDS games are, but because of the relatively weak specs, I imagine most things would reside in the same areas of memory for the entirety of the game, no crazy memory management stuff going on.
I'd be willing to write more than a few to improve the experience on the SHIELD for my favorite NDS games!

EDIT:
Turns out DeSmuME already implements Lua scripts. Might be wise just to copy that API design so you can reuse those scripts.