Title says it all
Is there any code samples thats very advanced or even expert like to give me advice on how todo stuff?
The book Lua Programming Gems has many great articles talking about the language. I think that book is what you're looking for, as they describe it as a "collection of articles recording some of the wisdom and practice on how to program well in Lua.". For example, the second chapter, written by one the creators of the Lua language, is about optimization.
As for code examples of how something is implemented, you can always look at how they do it in other addons.