How were codes in WW1 reciphered (to enhance security levels) without them turning meaningless?
The concept is called superencipherment or multiple encryption, and works as follows:


The original message M is enciphered using the code book, resulting in an enciphered message C1.
C1 is then treated as the plaintext, and enciphered using another method, resulting in a new ciphertext C2.
C2 is then sent to the receiver
The receiver uses the decryption algorithm for the second method on C2, obtaining C1.
The receiver then uses the code book to decrypt C1 and get the message M.


Creating an example:
Suppose I want to send the message "Small supplies of fruit expected. Buy as much as you can."
For my code book, I will use the A B C Universal Commercial Electric Telegraphic Code, 4th Edition.

Step 1: On page 128, we have the phrase "Small supplies of fruit expected.", with the corresponding code number 06375.  Moving to page 45, we find "Buy as much as you can." with the code number 02221. So in this example, C1 is "06375 02221".

Step 2: For the second level of encryption, I will add 13348 to each code number (ignoring any carry or borrow beyond 5 digits).  So to encrypt C1, we calculate 06375+13348=19723 and 02221+13348=15569, resulting in C2 as "19723 15569".

Step 3: The message C2 ("19723 15569") is sent to the receiver.

Step 4: The receiver decrypts C2 by subtracting 13348 from each code number.  So the receiver would calculate 19723-13348=06375 and 15569-13348=02221. This results in the message C1 equal to "06375 02221".

Step 5: The receiver then uses the code book to decrypt "06375 02221". Since I am using a one-part code here, again go to pages 128 and 45 to get the original message "Small supplies of fruit expected. Buy as much as you can."

As long as you maintain the sequence "Encrypt using A, Encrypt using B, send, Decrypt using B, Decrypt using A", the exact encryption steps can be replaced as long as the sender and receiver agree on the algorithms and keys.