I'm assuming the following for uniforms, Gold is operations (security, science, engineering, etc.), Red is command, Blue is medical. Data seems to have a lot of command responsibilities, and he is almost always left in charge when both Picard and Riker are gone. I know he has lots of science type of assignments, but I thought in one episode it was mentioned that he was on a command track (I think it was during season 3). Am I wrong that he was on a command track or are my assumptions on uniform colors incorrect? If I'm correct on those assumptions, is there any reason given for Data being in a gold uniform instead of red?
An officer who belonged to the command division sometimes wore the division color of another department in which they specialized if said command officer became a security chief, engineer, or commanded a science department. Memory Alpha -> Command Division
Since he did not require sleep, he routinely stood night watch on the bridge. He frequently participated in many of the away missions undertaken. His speed of thought and great strength made him an important asset to the ship, and the fact that he was unaffected by disease, radiation, or mind control was vital on more than one occasion. Memory Alpha -> Data
The Operations position, was typically manned by a member of the Command staff of a Starship, regardless of seniority. On the Starship USS Enterprise-D, Chief Operations Officer, Lieutenant Commander Data doubling as Second Officer), was thereby the most senior member of the ship's crew, excluding the Captain and First Officer.
In-Universe, Lt Commander Data wears a gold uniform to indicate his position as Head of the Operations Division as well as de facto Science Officer and Senior Operations Officer in addition to his position as Second Officer under Captain Jean-Luc Picard and First Officer William Riker.
Other members of Command staff have worn different colours than would normally be expected, notably Admiral Toddman who wears a gold uniform in the DS9 episode "The Die is Cast" confirming that a specialism (in his case Security) can override rank when determining uniform colour.
Out-of-universe, the decision was taken to present Data in a gold uniform because of the colour clash between the red (Command) or blue (Science) uniforms and the pancake white & gold face makeup and yellow contact lenses. He was moved from the planned "Chief Science Officer" position (the same role held by Spock, on whom Data was modelled) into an Operations position to justify the change in uniform.
You can see an example of this in the picture below (from Chain of Command, Part II) where Data's new red uniform definitely accentuates Brent Spiner's true skin colour through the makeup.