This is a grammar point you use at the end of a sentence. It sets a condition. It suggests a good outcome without saying it.
、。
I kept thinking, "If only he would come..."
なあ…
If only I had more time...
「?」 「。」
A: "You're not going home yet?" B: "Not if this work isn't finished."
、…。、…。
I should have said it properly back then... Ah, if only I had said it...
「、?」 「、なあ。」
A: "What do you think of this cake?" B: "Hmm, if only it were a little cheaper."