The Russians no longer need Pakistan's coasts, as they have India's. Having said that, Russia needs to expand it's markets, and what better way than to expand into one of the largest populated nations in the world, Pakistan. Granted, India outnumbers Pakistan 10-1, but Pakistan is an untapped market and Russia would do well to drill into it.
Anyways, that's off topic.
The engine isn't being sold to Pakistan directly, it's being sold to China who're assembling it for the JF-17 for Pakistan. Eventually, the Chinese are gonna re-export it directly to Pakistan and with the warming relations between Pakistan and Russia, I doubt that Russia is going to protest.
I think that in the long term, Russia wants to start selling Mil-equipment to Pakistan, in the short term though, there is no way that the Russians would jeopardize their intense (but receding) relations with India for Pakistan.