When you connect to a ap using ethernet it requires no authentication but the traffic must be encrypted with a handshake shouldn't it? So wouldn't an attacker be able to write a script when he plugs a raspberry pi for instance into a ap he would be able to find the password?
The key exchange is done wirelessly, not over the wire, so the wired clients are unable to intercept those transmissions. There is no reason why the AP should rebroadcast the handshake to its wired clients, so no, the scenario you describe is not possible.
Moreover, knowledge of the handshake does not allow someone to get the WPA2 key. For more on this side of things, see Are WPA2 connections with a shared key secure?