How is the type of deicing fluid chosen and how much time is required for application?
I'm mainly addressing your "with the software I want to determine if deicing is needed for a flight."

There are three possibilities for whether deicing is needed or not, which are based primarily on actual and expected weather conditions (both at the point of departure, enroute, and possibly at the destination) and the airplane's capabilities:


Deicing is obviously not required
Deicing might be required, but is not obviously required
Deicing is obviously required


No reasonable pilot is going to request deicing in a case where deicing is obviously not required, so that leaves us with the other two. (Remember that deicing costs the airline money, and a pilot who regularly requests deicing for a short local hop in the height of summer is probably going to get talked to by their boss about it.)

If deicing might be required, it's basically at pilot's discretion, likely supported by company standard operating procedures and airplane manufacturer recommendations.

If deicing is obviously required, any pilot who does not request (and wait for) deicing before beginning the takeoff roll is delinquient in their duties, and is putting both the passengers, the crew, and the airframe at risk. Unfortunately, there have been crashes where a decision to not deice in conditions that required deicing were a major contributing factor.

Thus, if deicing is determined to be needed, yet not requested and waited for, then the only safe alternative remaining is to stay on the ground; effectively cancelling the flight.

Consequently, the options are:


Deicing is not needed before takeoff
Deicing is needed, requested and waited for before takeoff
Deicing is needed but not requested, thereby precluding safe execution of the flight


If it is known while the aircraft is still on the ground that a flight cannot be done safely, then the flight should be cancelled.

A flight cancellation can, simplistically, be modeled as an infinite delay.

Therefore, we can conclude that if deicing is needed, then waiting for deicing is required, and whatever this means in terms of additional delay will simply have to be tolerated as a necessity for the ability to safely undertake the flight. It's really not different from inoperative critical flight instruments; if, for example, all attitude indicators or airspeed indicators disagree, you're just going to have to wait to get that fixed, too.

In an ideal world, the choice of whether or not to deice the airplane is entirely unrelated to the time required to deice the airplane.