This does the job for you:
UPDATE [rs_DEVICES]
SET [device] = dbo.pad_zero(12,[device])
WHERE LEN([device]) < 12 AND NOT EXISTS (
SELECT 1 FROM rs_DEVICES r1 WHERE r1.device = dbo.pad_zero(12,[device])
)
I think it's self explanatory, but if you have any questions please comment.
Honestly though, I recommend you to fix the real problem. Reassign the current references to the length=10
records to their respective length=12
siblings and then remove them.