As Adam said Anope does not know what port a client connected to, the reason for this is the IRCds simply do not tell Anope which port.
So this feature is only really achievable either A) in the IRCd alone or B) in Anope via a third party module IF the IRCd also runs a module to send Anope the port.