Your population is only checked against the cap when the liaison leaves the map after talking with expedition leader, mayor or baron. If you're below pop cap, you get 3 migrant waves, the size depending on your fort wealth. If above, you don't.
So, if you're one below the pop cap, the liaison leaves and you adjust the pop cap after the first wave, you get 3 waves of migrants total still. If you're one above, lose almost everyone in an accident, you'll have to wait for the liaison to arrive, talk and make sure he gets off the map safe to get migrants again.
Moral of this: don't make a bug report if you have no clue how something works, ask around first to see if it is really a bug. The wiki page is a bit vague regarding this, just saying it is "not fully understood". This is because sometimes you still get an extra wave and other oddities.
So, now to how to work it. The first 2 migrant waves can't be avoided since the liaison won't arrive yet. This usually ends you with between 14 and 20 dwarfs. Setting pop cap at 7 ensures no more migrants. The next waves are bigger, but unless you've been digging, smelting and making lots of gold or steel stuff, should get you aroun 60 to 80 dwarfs. After that it depends on your playstyle I guess. I've managed to end up with between 64 and 71 dwarfs in my last few forts consistently. If I let it go another year I usually get between 115 and 140 dwarfs in my fort total. I never leave it on the default 200, so I don't know how big the next waves would be.