Taco (or anyone) -- is there some simple Lua function which returns some
engine identification?
I'm thinking of something like
\directlua{tex.engine_ident()} (sorry, wrong syntax, I know),
which both luatex and xetex could implement.
(I concur with the opinions of only exposing \directlua.)