Get an app called Elixir from the market; it's free. I've only just installed it myself in response to your question, but it looks very useful. In particular, with about two minutes of fiddling around, I was able to create a widget to turn the wifi hotspot on and off, as you suggested.