serving a useful purpose in doing A, doing B
Does
"If art can console us and unite us with others through our shared sensibilities, then it serves a useful purpose in maintaining a social equilibrium, deferring our terror of death even while it reminds us that we will not live forever."
mean
"If art can console us and unite us with others through our shared sensibilities, then it can help to maintain social equilibrium forget our terror of death, even when it itself somehow reminds us that we will not live forever."