Its even hard to compare most historical figures for medieval sites because you don't know how much if any commons were inside the town limits.
how advanced was building, all 1 level huts, 1 level with sleeping lofts for fucntional mutli floored buidings.
Rate of trade -being on a travel route increased densisty
Rate of Industry- would both use up living space and demand workers greatly increasing densisty.
My guestimate is not so about saying the town is full or can take another 100-200 people but giving us an idea of how much bussle the town has, by falling within the medieval average we can expect busy street traffic, thriving trades and sucessfull but still limited retail due to pop level. Despite the danger I would suspect that as the average got near or above medieval levels more people would begin to risk living beyond the walls and internal rents grew higher. At this point I would say only farmers and herders would risk it, and some of them might only use primitive/temp shelter during the growing season and spend the off seasons living in town where manual labour jobs with the buidling crews were available.
With regards to modern rates, it has been found in some areas when you factor in footprint for a building, parking, access roads, and green space around vertical suburban dwellings don't have significantly higher densities than down town row housing.
A tower with the elevator core, several stairs, utility rooms, heating plant etc is is probably only 1/2 as dense as you would believe.
More modern condo's with limited parking, small units, no buffer from the street do however drastically spike density on that footprint but the demand for retail and services around such buildings begins to drag it back down again especially in North america where retail space/citizen in many times higher than europe or Austrialia.