CS is in the local scope (open the main lua file, it's literally the first line). If you remove the "local" then you can check for it like this in your addon:
lua Code:
function test()
if CS then
d("CraftStore loaded.")
else
d("CraftStore not loaded.")
end
end
To hide your addon, you'd add an event for EVENT_CRAFTING_STATION_INTERACT, ensure the craft skill is CRAFTING_TYPE_PROVISIONING and then you'd add an event for EVENT_END_CRAFTING_STATION_INTERACT to bring your addon back.