Well I don't the military co-operation between India and Iran was directed against third countries. And the military pact was basically as a result of continuing improving relations and close relationships with Iran after the Islamic revolution. I remember reading a paper published in the 1990s by an a prominnet American author where Moscow-Beijing-New Delhi-Tehran were the new emerging "axis" that will counter the West.
Coming back to the military pact, there was co-operation in naval particularly submarines. A lot of upgrades on soviet tanks in particular. We even had naval exercises in 2006 when Bush was visiting India and the Af-Pak region.
However, post 2006, the UPA policy has been to go for a downgrade of relations with Iran. There hasn't been any defence co-operation since then. And I doubt there are any assumptions of basing rights available to India in Iran at the moment.
Interestingly the period post 2006 also saw improved relations with GCC countries with defence/security co-operation agreements with almost all GCC countries including UAE, Qatar, Saudi Arabia and Oman (which are the oldest).
The perception, atleast in the GCC states in some circles is that there is an emerging China-Pakistan-Iran combine which they want to undermine as much as possible. Particularly seeing the bonhomie between Iran and Pakistan recenly after being so antagonistic with Iran particularly during the 1990s.