Yeah, and Poe was written to die in the crash after escaping with Finn, but they liked Oscar so much they wrote him back in half way through the movie.The problem with Finn is the same problem that drags the whole ST down: lack of forethought. JJ is habitually guilty of coming up with good elevator pitches, but not taking the time to develop them into coherent concepts. Most of TFA's half-baked ideas have "well that's the next movie's problem" written all over them. RJ to his credit actually tried to do something interesting and meaningful (though I could still have done without the pointless Casino Planet escapade.)
As a result, they just threw a Stormtrooper deserter in there because it's a cool visual and never been done before, but never bothered to develop a real backstory for Finn or chart an arc for him beyond the first movie. The bit about him having done sanitation duty on SKB was clearly just thrown in as a joke line. I have no clue if they'd always intended for him to be black or if that's just how the casting process shook out (I've honestly never looked into the BTS on this one much) so I can't speak intelligently about what element came first.
I will say though that as someone that grew up around the military, the idea that a soldier was an "ex-janitor" is a bit of a misnomer. Generally speaking, army camps don't have a janitorial staff because that's exactly the kind of thing you make the lower ranks do on a duty roster. Especially in the barracks.