I don't understand why you need access from the WAN, and why you would have to remove the router from 'the wall' to access the router's LAN so that you can configure your router after a fresh flash or reset.
It is a very bad idea to expose a freshly reset/flashed router's configuration (ssh and/or web) to the WAN in general, but even more so if there is no password configured (the default state after a reset or flash). A rare exception is if the device in question is already connected via its WAN port behind another firewall (i.e. already part of a trusted LAN), but there may be better ways to configure your router.
That said, if you want to do this, you would create your custom configurations and integrate them into an image you build yourself. There are instructions on how to do that here. Keep in mind that any errors or security issues introduced into the UCI defaults as a result of this process will exist anytime the router is flashed with that image or reset to defaults, and it could cause difficulties.
In general, the process of building your own custom image must be repeated for each new OpenWrt release. However, In your case, the good news is that you're working with an old device that will probably never be upgraded beyond LEDE (and LEDE is no longer being updated), so you can do this once and be done with it. But I will stress again that you should not do this unless there is a really good reason for doing so.