And yet another script that may be useful for demonstration and/or actual use:
MIDItoVKB.txt. This .zip download also includes a .ReaperOSC configuration file for REAPER's OSC Control Surface feature, optimised to use with this script (again, the Default configuration should also work just fine).
This script takes MIDI from the configured input(s), and sends it to REAPER as OSC messages, where it arrives as MIDI again at the Virtual Keyboard. This e.g. allows you to send MIDI from one system to another system running REAPER over the local network. I'd figure this would also be a good starting point for a script to process MIDI before hitting REAPER (e.g. change MIDI channel, invert note velocity, convert velocity to CC#, etc.). Perhaps useful for porting some JS MIDI effects to the world outside of REAPER ( / ReaJS, which unfortunately doesn't exist on OS X, afaik).