Looking at the earlier comments, that code was merged-in in ab997b8, hard to see the original context though since that is not a merge commit (just a regular commit).
It does mention this thread, most of which is obsolete. There shouldn't be anything special about recording-vs-playback, however I would put a couple of caveats on there:
most REAPER APIs are designed only to be used from the main (GUI) thread, not from audio threads or from plug-in-created threads.
pretty much anything done during playback should be able to be done during recording. If you're modifying track recording parameters, those parameters may not latch during recording until recording is stopped/started again (or the track disarmed/armed, etc).
from the main thread, if you set state, you might be able to interrupt audio, but in general it shouldn't be a crash.
I don't really know what the original intent was, I'd try testing a lot with that check disabled... but it shouldn't be necessary in general.
You could do this using REAPER w/ joystick-MIDI support and a custom video processor... would take a bit of scripting though, yeah. Maybe at some point I could do it... would you be looking for interactive realtime use, or for automated use to render later, or both? The way video is handled, realtime preview while recording automation is perhaps a touch tricky.