All of the information in this post comes from a presentation that Paul Bessire at WIS delivered in 2009. You may still be able to find this online somewhere. If anything has changed since 2009, what is listed here may no longer be accurate.
Step 1: Determine if an unusual event occurs (defined as IBB, WP, PB, SB, CS, SH, H&R, Balk, Pickoff) or if it is a normal PA
Step 2: If normal PA, determine if HBP or not
Step 3: If not HBP, determine if walk or not. At this point, if the PA does not result in a walk, then we have an "at bat"
Step 4: Determine if the at bat results in a hit or an out (included park adjustments and any platoon advantage)
If the result of an at bat is an out, then do the following:
Step 5: Strikeout, or "normal" out (and if it's a normal out, is it a groundout or flyout, and in which direction)
Step 6: If "normal" out, determine if an error occurs (fielding rating) or if it becomes a hit (range rating, minus plays)
If the result of an at bat is a hit, then do the following:
Step 7: Determine if HR or "normal - in play" (Park effects used to determine HR)
Step 8: If "normal - in play" then determine if fielder converts it into an out (range, plus play)
Step 9: If it remains a hit, determine what kind of hit: triple, double, single (Park effects used to determine type of hit)
The exact calculations along the way - such as whether an at bat results in an out or a hit - are where WIS's method of Log5 normalization are used. These are also impacted by: platoon advantage, park effects, and how much each outcome is dependent on the batter or the pitcher.
Yes, it is determined to be a hit prior to what type of hit...