So Flash has really insane micro and it's not easy to do without the correct method. I've been trying things out and here's what worked for me:
Wraith vs hydras or any other ground thing:
Use patrol, but it's important to note that you must click patrol near the hydras with the wraiths not looking in the opposite direction, they have to at least be looking sideways to the hydras for this to work. This is similar to how vulture patrol micro works, if you click patrol directly ahead of the vulture with the enemy behind it, it won't fire. You have to circle around a bit first.
1- Circle around the hydras sideways
2- Press patrol and click near them
3- Move away or continue circling around them
Wraith vs muta: (as seen on the gif above)
The above method works but only if they're not chasing you. If the mutas are chasing you, you need to use the hold method. Step 1 is mandatory or wraiths won't fire.
1- Right click near or below your group of wraiths so that they turn around almost instantly
2- Press Hold
3- Run away
Wraith vs scourge:
Use the vs muta method or use the triangle method if they're further away. Patrol on top of a wraith also works. Like with mutas, if scourge are chasing you, the "patrol near them" method won't work.
Some notes on wraith attacks:
For the attack to be executed, the target must be 1) in range already when you give a command, 2) the wraith must be looking directly at it, 3) in some cases the target must be the closest enemy, if something is closer the wraith might not attack at all.