If it isn't [someone's name]!

Solution 1:

What has disappeared from if it isn’t [name]! is an oath, euphemistically expressed or not, along a familiar pattern:

…may thunder strike me dead if e're i lov'd before i saw your all commanding beauty … Lewis Maidwell, The Loving Enemies (comedy), 1680. EEBO

Restore the oath and you get a complete sentence. A few examples:

“Lord save us!” said Matty, “if it isn’t his honour. You are ten thousand times welcome …” — Anne Newport Royall, The Tennessean (novel), 1827. COHA

“Why, it a'n't! Yes, I'll be switched if it isn't Harry Beckworth rose from the dead!” — Caroline M. Kirkland, A New Home — Who'll Follow?, 1839. COHA

“Lord bless me if it isn't young marster's sister.” — Mary Jane Holmes, Tempest and Sunshine, 1854. COHA

"Eh? Why, hang me, if it isn't Old King Brady. What are you doing here, you old fox ?" — “The Bradys and ‘Black Jack,’” Secret Service (detective magazine), 26 Feb. 1904, 23.

As @FumbleFingers has commented that the British minced oath of blow me down is commonly completed with an if clause, there is a gem I couldn’t resist:

Why blow me down if it isn't the local glamour girl — come to Daddy, Thelma! — R.F. Delderfield, Worm’s Eye View: A Comedy, Embassy Successes, v. I & II (1945–46), 11.

The complete form has certainly not died out, though perhaps living on with more contemporary swearing:

'F*** me if it ain't Burkett 359,' — Jeremy Cameron, It was an Accident, 2015.

Solution 2:

The expression could possibly be considered a protasis (dependent clause) which is missing its apodosis (independent clause):

  • If it isn't Jack Smith, I will be surprised.

But a better explanation is that the omission consists of what the Comprehensive Grammar of the English Language (p444) calls an initiator, i.e. a word to preface a statement. In this case this speaker would probably not have said simply:

  • If it isn't Jack Smith!

but

  • Well, if it isn't Jack Smith!

or

  • Why, if it isn't Jack Smith.

As the CGEL states in the section sentence types and discourse functions (p842):

Negative if-clauses, usually preceded by well or why, are used to express surprise:

  • Well, if it isn't the manager himself! ['It is indeed the manager himself!']

  • Why, if it isn't Susan! ['It is indeed Susan']

So, the expression can stand by itself as what has elsewhere been called an emotive interjection, in this case to express surprise and perhaps pleasure.