Welcome to the forums, Wouter! You need switch triggers. I think there is a Pending tute in the Ed Depot, and there are lots of threads - use the forum search function.
Once you understand switch triggers you will be able to create any counterattack you like.
unkie, the best way to simulate an enemy flanking you is with waypoints and switch triggers. However, you will need to do a lot of playtesting to make it look really good - to make anything look really good in OFP takes 50 - 100 tests. Depends on how complex it is of course, but you don't have to test it by playing every single AI unit.