Finder stores information that the file is an alias in the ResourceFork file. To read this metadata, I would use spotlight to determine the type of file; the following command will return the file type, so you can compare it in an if-statement.
mdls -raw -name kMDItemKind /path/to/test.pdf returns PDF (Portable Document Format)
mdls -raw -name kMDItemKind /path/to/test.pdf\ Alias returns Alias
Applescript, osascript. , :
tell application "Finder" to get kind of ((POSIX file "/path/to/test.pdf\ Alias") as alias)