I don't think the clam is doing this intentionally. In fact, I'm pretty sure all they know is to close if they are touched or something passes over them and to try and open when the lights are on.
If possible, try placing him inside a small ring of live rock rubble where he is not wedged and has enough room to open. He'll eventually attach and be stable. I have also heard of people using a small plastic cup of sand or rubble that can serve as a semi-mobile attachment point.
I try to keep mine on my live rock (which I know is not natural for this species) so he will be closer to the light. He has fallen on several occasions when rock shifts or a turbo snail goes into bulldozer mode. Could that be what's happening with yours? Sometimes I beleive they pump their shells rapidly to expel bubbles or remove sand, and might become upset as a result.
My lighting is a 150W metal halide and 24" T5HO blue. The clam has been almost all the way at the top of the tank and almost all the way at the bottom.
It is a violation of federal law to use this product in a manner inconsistent with its labelling.