It doesn't matter in which order the various clock-stopping situations happen during the down, you just take them all and find out if a) any of them cause the game clock to start on the snap and b) all cause the play clock to be set to 40. Otherwise the game clock starts on the ready and the play clock is set to 25.
In your situation, you have two reasons to stop the clock, and only one of these says a 40s play clock, so the play clock is set to 25.