There is a solution now for v4.x: Gl-iNET AR300M Network Mode Toggle · GitHub

Though it involves a reboot each time the toggle is used and in AP-mode the MAC adress of the LAN port is used for both ports, instead of the WAN MAC adress when using the GUI “Network Mode: Access Point” option.