As
@arslank03 pointed out, the two deals are not equivalent. Yes the cost for 4 054AP was less than Baburs, but Babus are frankly a more forward looking purchase. While the 054AP will be the most capable ships in PN, that will likely not be a long term position. The PN not only acquired 4 light frigates (refusing to call them heavy corvettes given they are the same size as F-22P), they also acquired with it access to European modern SAM which is much superior to the currently available version of HQ-16. Will that change if HQ-FE becomes available, maybe, but that is not the case at this time. THey also, during that agreement, cemented a relationship with a major european defense conglomerate in leonardo (whose subsidary, they have had long relationships with as well - Selex/FIAR). That is a political boon for Pakistan as if they provide SAMs and have offered to provide radars for JF-17 in the past, there are other avenues of cooperation likely available, helping to diversify the defense partners Pakistan has (this is not a small deal for a country in Pakistan's position).
To that end, Pakistan has used this deal, along with acquisition of TB-2 and Ackinci UAV, A-90B submarine upgrades and others, to cement a strategic partnership with Turkey, who is now seeking Pakistani involvment in their FGFA (KAAN), and provided not only the TOT to Pakistan to build Babur's in Pakistan, BUT also provided the IP to the Ada program so that Pakistan can modify the design (leading to the creation the Jinnah Class Frigate project)) and market the idea if they so choose. This effectively simulates what China did for Pakistan Airforce with JF-17.
So by spending the extra 500M pakistan cemented a strategic partnership with Turkey, giving another very reliable parterner (in addition to China) to Pakistan, who is desperately short on strategic partners and reliable allies. It allows for an additional source of high end defense equipment with strong potential for joint programs/cooperation (like it has with China). It further deepens its defense ties with Italy, giving an additional reliable defense partner. AND acquired the design for a modern workhorse for PN while providing jobs to Pakistani workers and engineers at KSEW.