I know it does more than what you are asking for but I use Tasker. There are several other advantages to using Tasker, and it is a paid app, but I've found several uses for it. Just to name a few;
>just as you asked I have a profile that turns WiFi on when I'm near home and it automatically connects when I'm within range, and disables WiFi when I leave.
>I have a profile that changes my screen brightness setting when I open certain apps, like video or photo apps.
>I have a profile that puts the phone into airplane mode when I'm at work and turns data on when I leave.
The list just goes on and on. While I've heard a lot of people who say they like JuiceDefender I've heard an equal number who don't. The biggest complaint about JD is it's flexibility, but as many who like it will tell you, it really depends on how you use your phone, and how well JD fits you. Basic JD is free so you can always take it for a test spin to see how you like it. Tasker has a
free trial that's accessible from the web so you could also try it. If you try Tasker it may seem a little daunting at first, but before you know it you'll be writing your own profiles and coming up with new uses. You can go
here to see a list of pre made profiles. If you try Tasker I suggest you go to Tasker Wiki from the menu in the app where you can directly download any of the profiles that others have made. Then tweak them to fit your need. By tweak them I mean someone may have wrote a profile who's on first shift so you find that you need to change or adjust the time to fit your schedule or they may store there music in a folder named x and yours is in a folder named y. The only thing it used to do that I miss is turn on gps. Google ruined that for us all with GB. Unless you run a custom rom that disables their UI for gps.
Good luck and please let us know what direction you went.