There's a tool called "sim" which does some level of what you want. I don't think it's at the level of cleverness you're looking for, but I found it useful for similar tasks. I'm fairly sure I got it from someone on this list, but I can't find the source now (all I've got is a MacOSX/power binary). I'll keep looking.