It’s not unheard of for general officers to keep their flying status up to date. For example, (since I recall it) of a crash incident from 30 years ago where the 16th AF Commander Maj. Gen. Winfield Harpe’s F-16 goes down. He was 53 years old.
https://www.nytimes.com/1988/12/06/world/us-general-dies-in-jet-crash.html
I’m sure the Admirals/Generals who are pilots may keep the flying status up to date (probably to get flight pay right?), however that’s probably once a month or whatever it takes to keep the flying status up to date and it’s strictly training and not in a real life combat environment like I’m sure will take place in the movie.
I just saw in an article that in the movie he is a captain. The first movie was 32 years ago and he was a Lt then. Figure he had been in the Navy about 4 years at that point so he’s a 36 year captain. Pretty slow advancement if you ask me and I doubt that there are any 36 year service captains out there. I’m guessing they keep him a captain so he can be doing operational flights because they believe even the public might have a hard time swallowing an Admiral out there flying into combat. Oh well, a little Hollywood suspension of belief. Just like their politics, it only has to be somewhat based in reality.