1, 2, 3 are correct usages of 差一点儿,although I would probably say "他差一点儿爱上她,但她搞砸了“ for 2 and "他很早就起床了,但还是差一点儿没赶上火车"
4 is not correct, however… :(. What is written is actually "even though we all live in the same city, we almost saw each other." If you want to say what you wrote in English, you have to say, "我们虽然住在同一个城市,我们还是很少见到面。 "
If you can say "almost" in English in the sense of "not quite, but close to occurring," then you can probably use 差一点儿。Also, the expression is almost always followed by a verb. (You don't use 差一点儿 in "There are almost 100 people here").
Other examples:
下雨后地面很滑,我差一点儿跌倒了。The ground was slippery after the rain, so I almost fell.
他突然从暗中出现,害我差一点心脏病发作。He suddenly appeared from the dark, and almost gave me a heart attack.
你这学期没好好用功,差一点考试不及格。You didn't study hard enough this semester, so you almost failed the exam.
他差一点就考进北京大学,好可惜没考上喔。He almost got into Beijing University, but too bad he didn't make it.
他开车不专心,差一点发生车祸。He wasn't paying attention while driving, so he almost got into an accident.