Evolutionary status of dense cores in the NGC 1333 IRAS 4 star-forming region