Actually, there's no way for a script inside an attachment to know anything about the object they're sitting on. While the opposite is true (an object can accurately determine the avatar sitting on it) an avatar can check if it's sitting, but not the object they're sitting on.
proposal: the change() event with the CHANGED_LINK flag is actually useless inside attachments, since attached objects can't merge or unmerge with other linksets. It could be used in an attached object to detect a sit event with related object.