Why use codewords?
Codewords are there to mark an event that has happened because it might have a consequence later on in the gamebook. They can be used to mark many things such as things you've done, things you've learnt or friends you've made.
What codewords can you use?
Some codewords have something to do with why you got them. For example, if you stole something, the codeword thief is used. In Moonrunner, these words were used, but backwards. When you read them in the gamebook, you can probably work out how you would have got them, so to a keen metagamer, these kind of codewords are clues. Other gamebooks use completely irrelevant codewords, which give no information away, or, if the author is really devious, misleading. One thing to point out is that having a codeword is not always good, so it's not a good (like rennur in Moonrunner).
Things you can do with codewords
In their Fabled Lands books, Dave Morris and Jamie Thomson made all of their codewords start with the same letter for each book (A for book 1, B for book 2 etc.) this gives you an indication of where you can get the codeword from, and it probably helped them a lot when they were planning out all the gamebooks at once. They have also put all of the codewords at the end for you to tick off, rather than just write them down as they appear, so it is something for you to anticipate when you play the gamebook and also, you can aim for getting a certain number of codewords.
Also, the Crimson Tide has a neat little trick where if you follow the correct path, you will get a sequence of codewords that give you a clue as to what you do at the end. Also, be aware that 400 is not the successful ending. That's a devilish trick.
Items as codewords
There are some items that you obtain purely to mark that something has happened, such as the crystal pendant in Lone Wolf 2 (yes, they are all free online, so don't spend lots of money on book 28 for Kai's sake). Anyway, an item could be a more physical version of a codeword, and may have other uses, for example, if someone sees the crystal star pendant, then they will know that you are friends with Banedon. Siege of Sardath also uses items as codewords - in their case, it has rings with numbers associated with them to show that you have made friends with the elves and the dwarves. In most cases, the item could be replaced with a codeword, but items have a difference feel to codewords. They are less abstract. However, if you lose the item as codeword, then things might break down. You will have to work out which items are more important because of what they represent rather than your actual possession of them (so you could replace the option with 'If you were given a crystal star pendant, turn to x', but then I guess you could just say 'If you met Banedeon in book 1, turn to x').
codewords in apps
The thing with apps is that a lot of what is going on can be put 'under the bonnet'. It might also provide some surprises. So, you may not know any more that because the guy at the market stall told you about the secret entrance to the castle that when you get to the castle, you avoid the guards. The app no longer needs to ask you any more, because it knows that you talked to the guy and it can skip the asking you bit (which means that you don't know that it was checking in the first place) and go straight for it. Now the question is - does that encourage more replay or less? If you know that the app is asking you something, you will know that there is an alternative at that point, but if you know that there are alternatives, but they are hidden, you might play the game more trying to find them all. Maybe it depends on your level of persistence?