Is there any difference between
\startluacode? The commands seem to have a similar purpose, but I have found some code does compile properly if the wrong one is chosen. When is one used? When is the other?
The difference are the catcodes.
For more information you can have a look at the source file