Where to store persistent data from LUA

Logs are buffered … and written to regular memory or an external USB log file. Flash memory is not in play (Logs for OTHER purposes do use flash memory).
The persistent state of device state variables … (i.e. the the /etc/cmh/user_data… file) is only written when Vera Crashes or periodically … also not a flash memory problem.

You could write your Variables to ANY device (i.e. attach the variables to the TRV directly. (Just create your own ServiceID and Variable name strategy).