One more question... How many street lamps count as one?
Not sure what you're asking, but each lamp counts as 1 PWP towards the limit.
I'm having trouble finding any guides about villagers moving and getting villagers from other towns. Things like the best times to talk to a friend's moving-out villager, how to avoid a random one moving in instead, do random animals move in after your 10th villager, or must it be triggered by a camper/foreign villager? things like that. If anyone could help or link to a guide, that'd be great! I'm at ten villagers and one is moving out soon... and I'm not sure how much time I'll have after she leaves to make any decisions.
I don't know of any guides off-hand, but I'll try addressing some of your questions:
the best times to talk to a friend's moving-out villager
On the day a villager moves out, they'll be in their house with their stuff all boxed up. Talking to a boxed villager in someone else's town will ensure that this villager moves into your town, assuming you have space (9 villagers or less).
do random animals move in after your 10th villager, or must it be triggered by a camper/foreign villager
The game will only give you 9 villagers. Your 10th villager must move in either from the campsite (by you talking to them and convincing them to move in) or from another town.
Villagers from another town can move in with you knowing, i.e. you talked to them when they were in boxes, or not, just through general online play or StreetPass with people when they have villagers moving out.
From what I know, the details of the latter (villagers moving in from playing online/StreetPass) aren't very well defined, but it definitely does happen.
how to avoid a random one moving in instead
Keeping in mind the above, the safest way to keep your 10th spot open is to keep StreetPass off, and not play online unless you're going to pick up a boxed villager from someone else's town.
If you really want to play online, you could ask the person you're playing with if they've had a villager 'go into the void' (i.e. a villager moved out, but no one picked them up) within the past few days, or if they have a villager in boxes/moving out soon. If they have, avoid playing with them in case the villager decides to settle down in your town.
I hope this helps.