✓ Accepted answer
Most memory management is taken care of for you, especially when you're talking about values like strings, numbers, Vector3s, etc. Some tips to avoid memory leaks:
- If you :Connect to an event, think about when you want the code you connected to stop. If you want it to stop earlier than when the object owning that event will be :Destroy()ed, you will need to :Disconnect it yourself (otherwise the :Destroy() function takes care of it for you)
- Make sure global variables don't reference things unnecessarily (as in the wiki article you linked -- the memory leak they show comes about because the script kept a reference to every child of the workspace ever, rather than the current ones)
- Identify what will be responsible for cleaning up objects you create. Fortunately, cleanup is usually just calling :Destroy(), but you still have to figure out when you're done with the object. Do note that most simple scripts don't create new objects, so there's nothing for you to clean up. But imagine that you have a Part in the Workspace that generates new Parts whenever a player touches it, then it would be best to consider how those new Parts are going to be deleted (ex maybe they'll time out, or maybe there's a limit to how many are generated but they will otherwise last forever -- anything is fine so long as you think it through).
Your concern is with strings that the player will only see once. No matter where you store them (whether in the middle of an if statement, like if myVar == "pretend this is a very long string" then, or a dictionary like you proposed), the string has to be kept in memory -- but, aside from reading it from a file, this is a fact of all computer programs.
You should consider the memory and performance cost of creating a table to be very small. The overhead of having "welcomeShop = "Welcome to the shop!" in a table rather than hardcoding it is also very small.
Otherwise, your dictionary creation method is fine (in terms of syntax). If you wanted you could put a comma at the end of every item (even though putting it after the last item is optional in Lua) - doing so means that you can change the order of the items or add new items without having to remember to add/delete commas.
However, there is no value in putting all your variables/values inside a single dictionary. The tools and text dictionaries are good, but if your scripts are all just going to say things like newDictionary.text.welcomeShop, you could skip the newDictionary creation (declaring tools/text dictionaries separately) and just have text.welcomeShop in your code - saves you typing and also is slightly faster (though dictionary lookups are very cheap, so don't worry about dictionary usage in general). (If you want maximum efficiency, also declare your variables local -- due to how Lua works, this makes accessing them faster - if you intend to have more than 100 local variables (can't remember if it's 150 or 200), you might hit the limit, but you shouldn't need that many).