Can a Dimir Keyrune receive a Cipher, and does the encoded spell stay?
Yes, you can encode it on an animated Keyrune; and yes, it remains encoded even if the Keyrune stops being a creature.



A creature is a creature. It doesn't matter how it became a creature. It's even less relevant that it might stop being a creature. (Any creature could stop being creature.)

Enchantments, Equipments and Fortifications fall off because State-Based Actions (SBA) specifically ensure they are attached to a valid object. There is no such SBA for Cipher cards. As long as the Keyrune remains on the battlefield, Paranoid Delusions will remain encoded on it. Of course, you'll have to reanimate the Keyrune to take advantage of the encoded card.



There's a reminder rule that covers this:


  702.98c The card with cipher remains encoded on the chosen creature as long as the card with cipher remains exiled and the creature remains on the battlefield. The card remains encoded on that object even if it changes controller or stops being a creature, as long as it remains on the battlefield.