I have a neighbor who revs his engine loudly over and over again, for anywhere from 15 or 20 minutes up to several hours at a time, several days a week, and has been doing this for over a year. It frequently backfires loudly as the engine slows down. It sounds like I live on a racetrack, and it's impossible to concentrate or rest while it's going on. I've talked with him several times, and told him how disturbing it is, and he says he's tuning the engine. Is there really a need to do this to tune the engine?
Indeed, some aspects of car tuning to require the revving and letting it drop many times in order to get it just right. If one is fighting a bad part and is doing diagnosis, it can potentially take hours. Then, repeat in a couple days with the new parts until it's fixed. That's a rare circumstance though. Typically it only takes a couple sessions to take care of issues and get it tuned (with periodic testing when the weather changes). I'd say it's most likely that he has no idea what he's doing and/or just likes to hear his car rev.
I found this snippet of information on megamanual.com. It's Greek to me but, it represents a reason someone might rev their engine while tuning it.
Side note: It is likely, depending on where you live, that there are noise ordinances in place that he is exceeding. I'm sure a friendly visit from the police would make him think twice before he revs up his engine again.
There is a video on YouTube showing how to set an engine idle. They rev it towards the end but not excessively and not many times. It doesn't require the noise level you're describing.