As a suggestion, you could define a global variable about your current nuget package latest version, also your current nuget package version.
Create two variable as LastVersion
and NewVersion
variable.

LastVersion
is the last version of your nuget package on the package source, you should search for it and give a value for it.
NewVersion
is the current nuget version you want to pack.
After that, use a powershell task with the condition of '$(LastVersion)'-eq '$(NewVersion)'
to cancel the job. You can refer to this link about the steps.
Or you could use exit 1
under powershell task with the below command to cancel this:
#if LastVersion is the same as NewVersion, cancel the job
if( '$(LastVersion)' -eq '$(NewVersion)')
{
exit 1
}
else
{
exit 0
}