Here is an interesting fact about ribbon behavior in CRM 2013.
With the command bar, commands that are disabled are hidden. With the ribbon, commands that are disabled are visible but do not respond to events.
And observed that ribbon button will be visible when my JS returns true but if it returns false it is hidden.
I have waste lots of time debugging the script and finally found this MSDN artcile. This is by design of CRM 2013.
Hope it helps..!