First you should get the goby out. After he's out, rearange the rock work especially where the goby hides. Turn off the lights and acclimate him a tiny bit ( about 10-15 min) and put him back in. He may be a little aggresive but after a while he should stop torturing him.
Ps I've...