I don't know about the intention on the shot -- I think no one does -- but here is the current WPA rule about unsportsmanlike conduct:
6.17 Unsportsmanlike Conduct
The normal penalty for unsportsmanlike conduct is the same as for a serious foul, but the
referee may impose a penalty depending on his judgment of the conduct. Among other
penalties possible are a warning; a standard-foul penalty, which will count as part of a threefoul
sequence if applicable; a serious-foul penalty; loss of a rack, set or match; ejection from
the competition possibly with forfeiture of all prizes, trophies and standings points.
Unsportsmanlike conduct is any intentional behavior that brings disrepute to the sport or
which disrupts or changes the game to the extent that it cannot be played fairly. It includes
(a) distracting the opponent;
(b) changing the position of the balls in play other than by a shot;
(c) playing a shot by intentionally miscuing;
(d) continuing to play after a foul has been called or play has been suspended;
(e) practicing during a match;
(f) marking the table;
(g) delay of the game; and
(h) using equipment inappropriately.