Unlike one in English, un cannot be used alone here.
En is a pronoun that refer to appartement :
...ou en louer un. (or rent one of them)
means
...ou louer un appartement.
Similarly, we can't say:
Je veux un.(I want one)
but we say instead:
J'en veux un.