I don't know of a way to programatically assign macro icons, however you can at least use this addon to make the icon window much bigger: LargeMacroIconSelection

Note: I haven't used it myself, so can't guarantee it works.