For reference, the following Squirrel code detects the use of first-person view.
function onPlayerActionChange(player, oldAction, newAction) {
if (newAction == 12 && (player.Weapon == 26 || player.Weapon == 27 || player.Weapon == 32)) {
// Do something here
}
}