This will be a two-part thing,
first check if there exist an icon inside the package (which should be inside a icons directory),
if no icon is found, check if there is an icon matching the package name in the root icons directory (should be able to override this directory).
Will be heavily based on my existing Update-IconUrl script:
https://github.com/AdmiringWorm/chocolatey-packages/blob/43be08be257d88da520971a6d888f152a68e4900/scripts/Update-IconUrl.ps1