but it is really just calling (down on line 77) the following:
Note that this template is iterating through the articles as objects. Woot!
This means you have access to the article’s methods, including getPubId().
$article->getPubId('doi') will return the published DOI, if available.
For double bonus points, the presence of the hook Templates::Issue::Issue::Article means you could write a plugin to perform the actual work, without modifying the core code.