I am non-tenured and have been offered a tenure-track position at my current university, but I don't want to stay here long term. What should I do? I work at a midwestern university in a very small department in a specialised field in the Humanities. I've been working here as a non-tenure track assistant professor, and have been offered a TT position. 
I genuinely dislike the place I live in, not for aesthetic or social reasons, but because I have experienced racial harassment fairly consistently since last year (the area is extremely conservative, and does not look kindly on difference of any kind. I'm brown, female and immigrant). It got so bad I had to file a police report against someone who had been harassing me at my apartment. That's not the only instance, though. I've been abused on the streets and told to 'Go back home where I come from, you b*&amp;T*h' while out running. Among other things. 

I was offered an extension on my non-TT contract a while back and would give anything to go back to the non-TT track with the possibility of leaving for another TT position outside the university after an undoubtedly difficult application season or two. 

I'm happy to continue working here, as I like teaching here, but I can't do this for another 20 years, which is what my department head talks about when he refers to the tenure track. I don't think I can live or work here for that long, no matter how nice it is to be wanted in the department. I've tried approaching him with a long list of the encounters I've had here, and he seems genuinely nice, but also said that there is nothing he can do, which I understand. Most faculty I discuss this with keep telling me to 'forget the racism, it's just a few idiots'. I can't be quite that sanguine about it. They don't seem to understand the psychological effects of living in a place where you run the risk of harassment every time you step out of the house. 

And yes, I get that the market is bad. By dint and design, however, I work on a rather niche subject which IS rather marketable. 

I am rather anxious about taking this offer, and was wondering what to do. Any tips or advice would be much appreciated.
There's nothing to prevent you from accepting the TT position (which presumably carries better pay and more prestige) while still pursuing positions elsewhere.  Indeed, having a tenure-track position may improve your chances of getting an offer outside, or may increase the leverage you have to bargain with if offered something elsewhere.  And there is absolutely nothing wrong with accepting the TT job and then leaving (after a year) for another position.  Your department head might not be happy, but this kind of thing is not viewed negatively by the academic culture at large.

In short, I see no downside for you to accept the tenure-track offer.