I need the heap to be verified each time the garbage collector (GC) finishes its work. I read this can be done by setting the environment variable COMPLUS_HeapVerify
The approach you mentioned is absolutely correct.
Go to Control Panel->System Properties->Advanced System Settings->Environment Variables.
If you have administrator privileges, add a system variable called “COMPLUS_HeapVerify” with a value of “1”; otherwise — add the user one. Note, in the second case you might need to log out and log on.
Hope that helps.