One correction: Turkey is not the "Middle East" - a small sliver of Istanbul is in Europe and the rest is in Asia Minor. Maybe that alone will make it a bit less intimidating for you psychologically. Still, it's an exotic place for many US visitors with lots of layers and diverse population - some are very conservative and others very secular, you'll pick up on that in the clothing and mannerisms. There are different neighborhoods in Istanbul that feel very different. If you spend time in the "New City" (Beyoglu/ Istiklal Street), I doubt you'd notice the difference between that and any other young, lively part of Europe. On the other hand, there are very old traditional neighborhoods, where you'll notice a striking difference and you may very well feel like an outsider (most tourists won't walk randomly to different neighborhoods off the beaten track like I did, though, so keep that in mind). In general, the Turkish people are very friendly and hospitable, there is no reason to feel like going there will make you unsafe somehow.
I've been there three times, spending about 3 weeks total or so, and would offer the following advice. Dress modestly (this will help inside mosques as well), don't call attention to yourself, and everything will be fine. As a young woman walking alone (and especially if you have light/ blond hair), you will stand out in some areas more than others, but honestly it's no big deal. You will have touts constantly trying to get you into their carpet shop or try to get your attention somehow. It's annoying, but not a safety issue. You have to learn just to ignore them, and you'll be fine. I had a fantastic time in Istanbul traveling alone. I would not hesitate to do it again. I think you will have less time on your own than you think during this very quick tour. I would arrive early and try to do some sightseeing on your own. Or, do it at the end when you feel more comfortable.
PS. Turkish Air is great (prices, service, food options) and flies from LAX, so you have an easy way yo get to your tour.