Sure it can, one time I had a command sequence that launched LyX, opened the UserGuide, scrolled it to the end, and exit LyX at the end. You can put any LFUN in this command-sequence.
and check if lyx crashes, and if the pasted text is what you cut? I guess the long term goal (?) is having either implementing something like MS VB using which you can program and test the features, or a Python wrapper that can manipulate lyx with knowledge of lyx datastructure and data. The latter sounds like vim python extension. Sounds too remote to me though. Bo