Can a person create a spell which has the same effect as a magical object? For instance, could a wizard create a spell that, like the Mirror of Erised, shows the caster (or his target) that which they truly want?
A person can use a spell with the same effect as a magical object; as shown with the explanation of invisibility cloaks in book 7. The cloaks can be made from demiguise hair, which would be a naturally occurring magical object. A spell can be used for the same thing, by casting a bedazzling hex or disillusionment charm on a regular cloak. A spell could also be used to cast a disillusionment charm on a person.
Effect replication might not be possible with all magical objects. Wands for one seem to be in a class of their own. I can think of no evidence in the books of someone creating or possessing something or using a spell that does a wand's job but isn't a wand. I also know of no evidence that wands can be created by any means other than by fashioning naturally occurring magical objects into a wand.
Your question also seems to ask about inventiveness in spell-making. There are numerous mentions of both Dumbledore & Voldemort advancing the study of magic. It is entirely plausible that a powerful & inventive witch or wizard would seek to create a new spell based on the witnessed effect of a magical object. However, like with levicorpus, it would be difficult (maybe impossible) to know if it was a new invention or a rediscovery.
For instance, could a wizard create a spell that, like the Mirror of Erised, shows the caster (or his target) that which they truly want?
Presumably, yes, but they would likely have cast it upon some reflecting or otherwise visual surface, like a mirror, water, or a tv screen. How else would the person see that which they most desired? I do suspect that item is probably unique.
Would it be permanent? It appears that only great wizards are able to make permanent magical items. Otherwise they seem to fade over time, like the Potter Stinks badges, or the invisibility cloaks that Ron talks about (how they become tattered and more visible over time).
Could it be reverse engineered? Presumably yes. You make note of all the properties of the said magical item, and you then construct spells to duplicate the behavior.
You could probably cast the Remembral enchantment on anything (maybe even yourself) and it would become red when you forgot something. The ball which contains the permanent enchantment is simply what has become the standard delivery for that spell.