Alright,Either use a branch before those stages and get this branch by script and block it
or
use a stage variable to identify this stage and do the logic.
I did a tutorial here [SCRIPT] Identifying a stage
i was wondering if there is a more efficient solution.