If he happens to come, what should I say?

Literal

By-chance he [subject-が] come-[conditional-たら], what say-[conditional-たら] good [explanatory-のでしょうか]?

~たらよい ('it's good if X'). The question 何と言ったらよいのでしょうか is a polite, uncertain 'what should I say?' The のでしょうか ending is a formal explanatory question — deliberative, seeking guidance. と marks the content of 言う (quotative).