Don't plan for a specific character to have a cameo.

When the plot calls for an NPC to show up with a particular clue, or to be rescued, decide if it's reasonable for that role to be filled by one of the old characters.

For instance, don't just decide you want to do a Superman cameo. But if the story calls for them to bump into another hero, look over the options for one who fits. If they're in Metropolis, go ahead and use Superman. But if they are in Gotham City, it should probably be Batman

Similarly, don't just decide to use D'Artagnan. If they are supposed to interrupt a swordfight, but they're in old California, it should be Zorro.