It turned out the procedure definition for luaL_openlib in the lua.pas file was wrong. I uploaded the final working example here: http://www.noeska.com/dlua/downloads.aspx

Are there more people here interested in lua? As it seems that the thlua is not maintained anymore. Meaning the lua.pas is not up to date anymore.