Well, its not really a chess by so called masters to be honest. If it was, Iran would/could have still played it like a master while avoiding being sanctioned by the P5(yes China and Russia included) and isolated by its 'Muslim/Arab brothers' and the international community. This has affected common Iranians ALOT and restricted/impeded the country's economic growth(Turkey and even KSA overtook Iran years ago economically due to this very reason). Its for this very reason Iran is trying so hard to get the sanctions lifted, because it is having a very very impact on the country(even the most nationalistic Iranian will agree with this). In short, just like Deng Xiaoping said: It doesnt matter whether a cat is black or white(i.e **** ideology/religion) as long as it catches the mice. China under Mao was in a similar situation with Iran today suffering from isolation/sanctions and relying on ideology to forge its policies/rule, only that China was far more powerful/influential than Iran. But luckily their subsequent leader recognise the folly on being an idealist/relying on ideology which brought no real gains to the country except sanctions/isolation, made them unable to achieve/tap their real potential and made them lag behind their competitors/rivals, reason they changed their policy completely and the rest today is history.
In short, we should all be pragmatic/realistic, you should NEVER rule out being an ally/partner with another country, if your interests match why not? Interests always changes, just like alliances, however ideology/religion fanaticism makes it impossible for countries to be flexible/adapt according to changing world situation/conditions, which is a huge handicap for a country. As i said big powers like Russia and even China sometimes cooperate with the U.S/west despite them being rival(a farrrr bigger one than Iran can ever be). So iran ought to look for its interests first and foremost, even if it means sometimes cooperating with the U.S/west and even Israel(many other muslim countries do) on some Projects/issues as far as it helps Iran, so what?? Making radical rhetorics every time about uniting against U.S (especially when you are negotiating a crucial nuclear deal/sanctions lifting) isnt a wise move, helps in achieing nothing really other than bringing even more pressure/trouble for Iran. Iran should be more realistic.
China-US Cooperation: Key to the Global Future
China-US Cooperation on New Energy Makes Progress
China, U.S. seek stronger cooperation on anti-terror, cybersecurity, hunt for corrupt officials - Xinhua | English.news.cn
Russia's Putin softens anti-US rhetoric with call for economic cooperation - INTERNATIONAL
Russia's Vladimir Putin says ready to work with United States | Daily Mail Online
The Moscow Times - Breaking News, Business, Culture & Multimedia from Russia
Artic Exploration Offers US, Russia New Opportunities to Cooperate / Sputnik International
That's how mature powers behave, cooperate when necessary and compete at the same time.

Most of your observations are true... but you gotta consider that Iran never dislike being in good relations with all world (except occupied Palestine of course)... It is not Iran that does not want to be in good relations with world... If you read modern history of Iran, you clearly see that Iranians were hit hard by West when tried to install their democratic system... also after revolution Iran kept their relations with US (despite hostage crisis and the later deals in Lebanon) until US and other western and eastern countries decided to back Saddam regime with their full strength with its invasion of Iran... If you go to streets of Tehran today and ask ordinary people if they like Americans or hate them... you will see that a majority of them like to be in good relationship with west and east...
The problem of the west with Iran is that it does not like Iran to have its own words and decide for itself.. they never bare an state in ME to be inspiring and act independent of Western agenda... All their problems gonna be solved when Iran submit to them saying "ok, you,re the master... let,s do whatever you say from now on.. I will modify our beliefs and planned targets to your standards!!"
Look at their history of sanctions: If you are a fair person you see clearly double standards... Human right in Iran deserved Iran to be sanctions while Iran comparing to their Arab allies is the cradle of human right!! They use this as a mean to force others behave like they want... look at nuclear talks... Iran is under harsh , inhuman sanctions for a long time while Iran has no bombs, has no intention to build bombs and never had enough centrifuges to do so, even Iran is an NPT signer, Iran announced everyday that It is HARAM by our beliefs and we never do it (you know it has serious consequences for leaders to act against their Fitva... even more bad results with their own people)... They treat Iran like this and let Israel get away with hundreds of ready-to-fire nukes, while they never signed any non proliferation treaties and countries request to ask Israel about its nukes are always VETOed by US in Un council!! Pakistan and India has the same fate... The Pakistan even receives aid from US!! IF they have the right to have nukes with excuses that they have nuke capable enemies..then Iran is surrounded by nuke capable states... two of them threatening Iran everyday to bomb it!! See what a not fair and jungle style world we have that US asks Iran to abandon its missile projects, leave it nuclear tech, leave it UAV projects while they are threatening Iran everyday with ATTACK and INVASION... Is in,t foolish to even announce such requests?? they ask Iran to disarm itself against US and Israeli attacks!!! The S-300 story and BB and Obama objection has the same logic... they say, Iran should not be in a state that we can not bomb it!!!
Iran after revolution can never go to their arms, doing what they say, It has roots to Iranian culture and beliefs... they can never act like Arabs submit to other forces... Iran is very special country in world... it is No.1 source of energy in forms of oil and gas... it has very strategic location... it is an inspiring force for shias around the world... This is a country West would like to never let grow stronger, this is why Iranian strategists realized long ago that we are alone and we must build Iran with our bare hands, or just submit ourselves... Iranian case is different from Turkey... Iran can not both have the privilege of being with every country in world and at the same time be itself...
In this world, if you want to be great and acquire your share of the world, you need to be strong... It is a jungle... stronger eats weaker... if you are weak you have to submit, otherwise you will be eaten... In the course of history,,, the only way super power could become super powers was through force...showing to other big players that you are big too and you want your share... this is the base of every economic, social and political system in world today...
Although Iran as you said, would certainly grow faster economically if it let some of its beliefs to be abandoned and some of their qualities to be moderated... but the relationship between Iran and West and East was never economical but more of a principals and systems...
If Iran can hold its strategic plans and the way it intends to act the way it is now in next 20 years, and at the same time, use its smart diplomatic brain then in couple of decades a new Iran with a superpower position would emerge that not only west and east stop confronting her but to cooperate and share the world between each other... At least this is what I dream for Iran... I think if Iranians apply the same strategy they used to grow big in science and tech and
weaponry to other fields like economy, regardless of all sanctions and limitations it will succeed... I hope so...
I dream a world that no country in world can dare to dictate its agenda to other independent states and all have equal right to benefit from world scale relationship.. equally and with equal respect...