Is this a good algorithm to unflat js objects?
Nice code!


You should point out assumptions in a comment. You could document, for instance, that if the first encountered subproperty of a property is numeric, it's treated as an array.
I would rename messages to something like value. property is fine, but you could also consider key.
Right now, your code won't work with direct arrays. The following messageObject won't produce the expected result:

messageObject = {
    'array.0': 'Code',
    'array.1': 'Review'
};

There are some very specific edge cases: messageObject = { 'constructor.name': 'renatoargh' } will return an empty object. I'm not really sure what can be done about this though...
Finally, just for fun, you can use something like var key = property.splice(-1); to eliminate the second if in your for loop. Of course, after the loop, you'd have to add currentNode[key] = messages;.