My daughter's G4 mini had this high-fan-persistent-sleep problem, and it had been getting worse and worse, to the point where she virtually stopped using her computer entirely (hogging mine instead).
I think I just solved it. As a test, I have Handbrake ripping a DVD right now -- a huge processor load for this wee machine. The fan's running, but not racing. It's been crunching away now for about an hour now, and no sudden sleep. Before now, this would have been unthinkable -- watch a couple of YouTube, and the sleep cycle would start.
The answer was simple and obvious: dust. Your mini needs an intensive internal cleaning. You'll need a putty knife and Philips screwdriver (to open up your mini and expose its guts) plus a can of compressed air.
http://ifixit.com has a good walk-through for opening the mini and removing the mass storage assembly. When you do that, chances are that you will see a dust-caked circuit board, fan, etc. I'm no computer repair technician, and I managed the task.
Here's the iFixit walk-through.
That dust has been trapping the heat, and causing your mini to overheat (or to think that it's overheating). At that point, it goes to sleep to protect itself.
Blast the dust out of every nook and cranny, including the fan. Snake your air-can's straw into every crevice. Then reassemble, and voila!
We're now well past an hour, and Handbrake is still merrily converting video on my daughter's mini. I can't wait for her to get home so I can tell her that her computer's back to normal.