If your nnid is linked to your console then you will be able to download it again but if your are not able to log into the eshop then they are gone forever. The games are linked to the console and your nnid. They only way you would be able to get them back is to maybe buy a new console and have nintendo transfer your nnid. You have to have the serial numbers for both consoles.
Are you sure that a format will fix your ability to access the eshop? I would hate to see you go through all this for nothing.
I have a similar question, I got a second hand 32Gb Wii U with nintendoland disc and zelda WWHD code.
system was formatted.
I sadly didn't check the fw version prior booting Bayonetta1 and updating to 4.1.
I don't know if the Zelda code was used.
I don't want to update the Wii U and try the code for nothing. (also I'd like to kee a low fw ver. in case of a kernel exploit, also I don't have DSL, I use 3G+ cellphone for now and with get DSL once I'm not a student anymore)
Is there for me a way to know if the Zelda WWHD code still works ? If I create a NNID on this console, I should theretically be able to DL the game right ?