Shh! We don't need another excuse for a bunch of crusty sergeants-major to get together and burn some more TAD funds.
Seriously, though, good question.
MCO P5060.20 does not address being uncovered in uniform:
"2. By Individuals. Individuals in the Navy, when in uniform and covered will
render the appropriate salute (hand, rifle, etc.) as indicated below. Persons not in uniform will stand at attention, face the flag and place the right hand over the heart. Gentlemen, if covered, remove their headdress with the right hand and hold it at the left shoulder, so that the right hand is over the heart."
However, the United States Navy Regulations (which we are governed by) are a little more specific:
"Whenever the National Anthem is played, all naval service personnel not in formation shall stand at attention and face the national ensign. In the event that the national ensign is not displayed, they shall face the source of the music. When covered, they shall come to the salute at the first note of the anthem, and shall remain at the salute until the last note of the anthem."
It goes on to state that morning colors ("To the Colors") and evening colors ("Retreat") are treated the same as the national anthem.
It looks like when you are covered, you salute. When you are uncovered (but in uniform), you remain at attention. When in civvies, you put your hand over your heart.