Fascinating topic! Although I don't have any experience with captive octo's, the behavioral contexts in which cephalopods use different body patterns was the focus of my undergraduate thesis.
Body pattern expression in response to environmental stimuli (the camouflage for which octo's are so famous) are more apparent and easier to properly study, but body patterning as an expression of internal emotional state is supported by evidence both anecdotal and empirical. It can also be noted that, in most cases, inter- and intraspecific signaling is more complex in the teuthoids and speioids than in octopods, reflecting their vast differences in sociality.
Passing Cloud Displays may be used solely as a method in hunting prey, but Zebra Displays, Deimatic Displays towards predators, and body patterns during sexual encounters seemingly only have communicative functions.
Here's a photo of different O. insularis individuals from Jennifer Mather and Tatiana Leite's article in a 2008 American Malacological Bulletin (a fantastic publication), just to reinforce the diversity of displays we can be talking about!
Reference:
Leite, T.S. & Mather, J.A. 2008. A new approach to octopus? body pattern analysis: A framework for taxonomy and behavioral studies. American Malacological Bulletin. 24, 31-41.