Checking for Confusion should be the very first thing you deal with after you announce what attack you want to use. Contrary to the "Full Details of Attacking" steps found in some older rulebooks, it must be done prior to making any choices the attack requires (such as choosing an opponent's Pokemon), paying any costs (such as discarding energy), flipping a coin to see if the attack fails, etc. So as soon as you announce which attack you are going to use, you must check for Confusion immediately before proceeding with any requirements of the attack or effects on the attacking Pokemon.
Source: TPCi Rules Team (2014-09-25)