Hi!
I wanted to switch off the radio by using the ez-setup button.
Here is how I approached the question.

login (via telnet or ssh)
create /usr/local/sbin/ez-setup :
----
#!/bin/sh
TIMEOUT=45
if [ $(wl radio) = "0x0000" ]; then wl radio off; exit; fi
wl radio on
C=$TIMEOUT
while [ $C -gt 0 ]; do
printf "\x02" > /dev/gpio/out
sleep 1
printf "\x00" > /dev/gpio/out
sleep 1
if [ $(wl radio) = "0x0001" ]; then exit; fi
if [ $(wl assoclist | wc -l) -gt 0 ]; then
C=$TIMEOUT
else
C=$(($C-1))
fi
done
wl radio off
----
then
chmod +x /usr/local/sbin/ez-setup
echo "sleep 25; wl radio off" >> /usr/local/sbin/post-boot
flashfs save && flashfs commit && flashfs enable && reboot

After you turn on the WL500gp, the radio is switched off. To turn it on, you have to press the ez-setup button for a few seconds. The power led starts flashing (I could not control the air led that is always on, even if the radio is off, at least with the firmware version I am using). If within 90 seconds (2*45, but you can change this value) one client connects to the ssid the connection is maintained otherwise the radio is turned off again.
As long as at least one client is connected, the radio is kept on.
After all clients are disconnected the radio is turned off again.
If you have comments or suggestions, feel free to open a discussion.
Cheers,
Luca