How are changes in density of matter as universe expands measured? In this answer John Rennie says about deciding whether something observed by astronomers is matter:

... when we say matter we means anything that scales like matter as the universe expands.

This implies however, that we can measure how the observed thing scales as the universe expands. But on human time scale the universe is pretty static, so how do we actually measure this rate of scaling?
 A: This is going to be a bit vague since my knowledge of cosmology isn't great, but since no-one else has answered I'll put down what I know.
You're quite correct that we can't wait around a few billion years to see what happens to dark matter, but we can look back in time by observing distant galaxies.
The presence of some extra gravitational source in galaxies was discovered by Vera Rubin in the 1970s. We can't say a lot about what this gravitational source is from direct observation, though we can use galaxy modelling studies to infer some of its properties. Galaxies are gravitationally bound objects and don't expand as the universe expands, so what ever the extra stuff is in galaxies it isn't being diluted by the expansion of the universe.
The presence of some extra gravitational source in galaxy clusters was discovered by Fritz Zwicky in 1933. This considerably predated Rubin's work, but I mention it second because I'm working up the size scale. Like galaxies, galaxy clusters are gravitationally bound so they don't expand along with the universe and the extra gravitating stuff in them isn't being diluted.
So neither galaxies nor gravity clusters are very helpful when it comes to understanding the behaviour of the extra stuff as it dilutes. However given that we know this stuff exists inside galaxies and in the space between galaxies in clusters it's a reasonable assumption that it's everywhere, in which case the extra stuff in between the biggest gravitationally bound objects (galaxy superclusters) is being diluted by the expansion and we can study its properties by looking at its effect on that expansion.
This is exactly how dark energy was discovered. If we look at distant galaxies, i.e. look back at what they were doing in the past, we find their recession speed isn't as great as we expect. That means there must be something present that is accelerating the expansion i.e. dark energy.
Anyhow, if the expansion dynamics are dominated by ordinary matter then we find the scale factor depends on $t^{2/3}$ and this is something we can check experimentally. I have to confess my knowledge of cosmology is rather scant and I don't know exactly how this is done. However assuming I understand correctly, the expansion of the universe from the CMB era up to a few billion years ago (when dark energy started having an effect) is compatible with the extra stuff having the same equation of state as matter.
Which is where we came in.
Although we can't probe the equation of state of the matter in galaxies and galaxy clusters we can infer some of its properties from modelling galaxy cluster and galaxy formation. This is an indirect measurement, and again I have to plead ignorance of the details, but as with the expansion of the universe the results are compatible with the extra stuff being regular matter.
