I know it's possible to write a VSTi that's an audio effect. But, I was wondering, is it possible to make one that's a MIDI effect? E.g. a VST that catches MIDI notes before they go to the instrument and edits their pitch, velocity, etc.?
Yes, it's possible, Cubase has many of them built-in - https://steinberg.help/cubase_plugin_reference/v9/en/plug_ref/topics/midi_effects_r.html There is, however, no real SDK for it.
VST3 drops a lot of the support for midi that VST2 had.