Sometimes the solution is easier than it seems.
Instead of trying to write a classification script to be used with login.conf where I'm not exactly sure I would've really known what I'm doing, I stumbled across a much easier solution by modifying two lines in /etc/ssh/sshd_config:
Code:
(...)
PrintMotd no
Banner /etc/ssh.motd
The first line suppresses the regular system motd while the second contains a path to a different motd file that gets displayed instead.
Now the same user sees /etc/motd when logging in on the console and /etc/ssh.motd when logging in through ssh. Problem solved.