You may change this line of code
SELECT @Sql = @Sql + ' WHERE #ins.' + @PKCols + ' = ' + @TableName + '.' + @PKCols
to this
SELECT @Sql = @Sql + ' FROM #ins a INNER JOIN ' + @TableName + ' b ON a.' + @PKCols + ' = b.' + @PKCols
Another story is that after the change you'll probably receive an error: Msg 570, Level 16, State 1, Line 1 INSTEAD OF triggers do not support direct recursion. The trigger execution failed.
Here's a good article about INSTEAD OF triggers and recursion in MSDN. Check the Remarks section.