Why make a global variable when you already have a condition that checks for visibility , I like to keep things clean and simple . Try this out for size :
Event
Mouse->on object clicked -> othersprite
subevent ->yoursprite ->is visible .......action->yoursprite->make invisible
subevent ->else
->yoursprite->(inverted)is visible........action->yoursprite ->make visible