I would simply do 

     if (cheatEngine) return; 

before both if-statements.