Well, I've refined it a bit, and hopefully made it easy to add new devices. I'd like to be able to do both keyboard and mouse with one board. I've put the code
here. It seems to be fairly reliable at this point, although still doesn't do any address collision detection. ADB is amazingly forgiving on addressing rules. Theoretically, the host will ask each device for their ID and a "handler ID", then reassign you to a different address. However, when a device wants to talk, the device just stretches the stop bit on the next command issued by the host. So, the host knows a device wants to talk, but doesn't know which one (or how many). It will then ask every device ID if they need to talk. Since it enumerates all the devices every time, you can get away without actually paying attention to renumbering, assuming there's no collisions of other people equally reckless.
I could probably do both PS2 keyboard and mouse to a single ADB port that implements keyboard and mouse on the bus, with the current board I'm using. Alternatively, the USB board will be arriving soon, and supports OTG, so I can plug a keyboard or mouse into that and have it show up on ADB. Unfortunately, I don't believe this board will support hubs (there's no sample code for hub support anyway), so it'll be one device at a time.