It’s possible that someone enters a URL that isn’t part of the
‘package-archives’ variable. If the name entered doesn’t correspond to a name in
‘package-archives’, use it directly, assuming that it was a URL that was
specified.
Typos are too easy having to type in the ‘archive-url’ argument every time on
its own. Since you’re probably posting to an archive that you also use, reading
from the ‘package-archives’ seems appropriate.