So I recognize that supply and demand are harder to implement than the current system and more processor intensive, but the fact is that too many dwarves don't make enough money to pay rent and wind up getting evicted under the current system.
Here's how it looks to me that the current system is setup.
Nobles, weaponmasters+ and all dwarves with a legendary skill don't pay rent, and can take any unowned item for their own.
Dwarves who make stuff make some amount of money for each item they make
Farmers? Unknown
Building stuff? Unknown, but probably on a per construction basis.
Soldiers and Guards? Seem to get paid pretty well, I'm guessing a salary.
Haulers get paid a small amount for every trip they make.
What this has meant in my fort is that unskilled labor winds up kicked out of rooms, non-legendary craftsdwarves wind up kicked out when there is enough of what they make for the moment, and most rooms are taken up by children, legendaries, and soldiers (who often don't even sleep there) as well as those with steady business (fishers and farmers, etc), many rooms wind up empty.
Obviously one reason that most pay is on a per item basis is that dwarves can have multiple jobs. Assuming that soldiers get paid per time period it seems possible, though, that salaries can be programmed.
What I would propose, therefore, is that every dwarf with hauling jobs enabled gets paid a stipend, enough to afford a small room with a bed. Non-legendary dwarves should still get paid for skilled labor, based on item quality when possible, but if they have hauling enabled as well this becomes additional supplemental income. So a craftdwarf may sometimes have to move to cheaper housing if work is light, but nobody (except soldiers sometimes) has to sleep in the barracks if there are enough cheap rooms and they have at least one haul job enabled.
Oh, and what a cheap room is could be a user settable value, so the player can decide if it is value equivalent to a 2x1 with a bed and a door or a 4x4 with smoothed walls and assorted furniture.
It would obviously be nice if there was a more realistic supply and demand economy at work, but I think even a small tweak like this would make it so that fewer treasurers have to die in a pool of lava and people who don't want to turn off rent don't have scores of homeless while bedrooms lie unused.