The correct way to check if your app has been pirated requires two steps:
1) You must be running on a jailbroken system. Check this by trying to read from outside the sandbox.
2) Check if your app's signature is invalid. Checking this is fairly involved. Look around for code.
If either of these two are false, then you've not been pirated (point (2) will be true when your app is checked by Apple but point (1) will be false).
For Mac App Store apps, only point (2) is required.
The author of the app in the article has only checked point (1) (and additionally checked an irrelevant point by checking for Installous).
Incidentally, the preferred action if you've detected a pirate situation is to exit(173).