A similar question was asked yesterday on the OpenWrt forum. Here is my reply.

https://forum.openwrt.org/viewtopic.php?pid=325692#p325692

To configure the switch refer to item 1. The script is from my AR150.

“My requirement is to set the box in repeater mode, but during the power on stage. Would like to scan the APs, and pick one of them and set it as the WAN Wifi and do a network reset.”

Terminology alignment may be an issue here. Repeater usually referees to the same LAN segment. Your reference to WAN suggests you are running this as a router and connecting to another network. I think you mean bridge. The basic travel router scenario has the device configured as a standard router. The STAtion (WAN side) connects to a (hotspot) AP, and the LAN\WLAN to your client devices. This offers you a firewall between your devices and the rest of the world (but does not secure the data between the STAtion and hotspot).

This is a new article which will let you connect on the SAME LAN and is called repeater bridge.