The only reliable idea popping into my head for now is to write an ASM hook to wherever the main battle loop is, loop through the opponent's party, check to see if they only have one pokemon with more than 0 HP. If true, toggle this catchable flag, and then branch to the rest of the main battle...