@Raymond ZJH "expandStyle" corresponds to Object > Expand Appearance in the menu bar. Expand Appearance, as the name implies, expands the appearance of a path with an appearance attribute (effect or transparency), producing a group (representing the stroke and the fill). The script tests whether or not a path's appearance is expandable.
The script works as follows: You're asked to select a path. This path is duplicated. The duplicate is selected. Expand Appearance is invoked. At this point, if the item which is selected is a group, the path's appearance is expandable, i.e. there is an effect or transparency. In the end, the duplicate is removed.
The script has it's drawbacks. First is runtime, as @pixxxelschubser points out. This is particularly relevant if you want to test nested items, which will add (probably unmanageable) complexity to an already sluggish script. Second, if a path has either a stroke or a fill but not both, expanding appearance will not produce a group. Odd effects will also not produce a group, giving a false negative.
On a positive note, a similar approach has worked for my needs in the past.