Yes, that's what I meant about the Osmanli being bothered by the Shia but not necessarily for the sake of religion. It involved control of the eastern borders, justifying expansion and legitimacy, Selim's policy against the Kizilbash compared to his father's etc. That the Ottomans eventually became the guardians of the Hejaz also tipped the scales pretty decisively in terms of Sunni/Shia in the Ottoman lands. How much was geopolitics and how much was piety and how much space was there between those two things at the time.... well that's definitely hard to tell as you say.I think I agree with you, it's hard to tell. The Iranians and Ottomans adopted Shia and Sunni Orthodoxy respectively at the same time in order to try to legitimize themselves against each other and justify their wars. In other words, the religious conflict was because of the geopolitical conflict, not the other way around. Neither were particularly orthodox before they clashed, and actually they were nearly reversed - the Ottomans were very heterodox, and the Safavid order was initially Sunni-ish.
It was pretty critical, as the Safavids had a lot of support in Anatolia, which the Ottomans couldn't easily crush without convincing everyone they were heretics, and vice versa.
I've written elsewhere as to why I think Morocco is tough for the Ottomans but in a world where everything goes right I don't see why they wouldn't become a vassal state in the way the Algerians did. I still don't see them making much headway in Spain as I don't think they could have gotten west faster than they did and by then Spain was too strong that close to its heartland. I think that with a stable border in the west (and vassal states in Austria and Hungary) they will focus on the steppes.