Try getting the aim origin, then check for all entities in a small sphere that it's center is the aiming origin, and then check fm_is_bbox_in_sight() (or fm_is_ent_visible()). If the functions return false and there's a player near the aiming origin, there's a player half-visible behind a wall.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ