This was installed as a big, big mess. That bare wire isn't ground, it's a dodgy neutral because the guy saved money buying the wrong wire. And this mess intersects the NEMA 10 problem: the way old dryers were wired, which is both dangerous and illegal by today's standards, but is technically "grandfathered". The 400' distance both hurts and helps. Sharing this as-is between an old dryer and a modern EV charger is out of the question.
You are correct that electronics experience doesn't map well to electrical. For instance Ground is entirely a safety shield over which current should never flow except during fault conditions. Being AC, eddy currents matter, so only tree diagrams are allowed; currents must be equal (cancel out) in every cable. It is also much easier to detect current flow; no shunts required :)
So let's get to work.
Like the rest of the addition, this is a mess. You haven't told us about your layout except that it's 400' (that is both a curse and a possible blessing). As you know, there are two hot wires in the cable; the question is what the bare wire is doing. It's an important question.
The EV charger requires Hot-Hot-Ground. It is a 240V only device with no need for neutral, since it has no 120V parts internally.
The dryer is wired Hot-Hot-Neutral. This uses a NEMA 10-30 connector. Neutral is a live conductor that returns current normally. We call it neutral because the equipotential bonding of the electrcial system places it near earth potential.
Our mantra: Neutral is not ground. There are many conditions (mostly routine, common failure conditions) when neutral is not anywhere near earth potential. And that is fine, since we treat neutral with the respect of a live conductor. Usually.
The original way of wiring dryers and ranges was Hot Hot Neutral, because grounds did not exist. When grounds came in in the 1960s, they decided to break the rules and go ahead and ground dryers and ranges on the neutral wire, on the logic that this wiring is rarely disturbed, never complex and therefore unlikely to fail. This is still problematic, and it does kill people, and it's outlawed in new work and has been for a long time. Now, dryers and ranges must be wired Hot Hot Neutral Ground (NEMA 14) which is a universal donor that can also supply Hot Hot Ground (NEMA 6) loads.
Is this wire even a legal neutral wire? The precedent for bare neutral wires is that in the days before grounding, a lot of dryer/range circuits got installed with SE (Service Entrance) cable, which is intended for prior to the service point and so doesn't have ground. However this guy just used /2 NM cable, I'm not sure that's legit. But it's legal as a ground wire. Dryer can't use that. Boy, this sure would be easier if the dryer was hot-hot-ground...
Option 1: Hack dryer to be hot-hot-ground; retask wires
Dryers use 240V for their heating elements and sometimes controls and motor. They use 120V for controls, lamps and motors. Many manufacturers also ship dryers to East Asian markets like the Philippines which have both Euro and US style power. In those cases, they "hack" the 120V loads to run on 240V, either by substituting 240V motors or by adding a small 240/120 transformer to supply the 120V load. You can do the same thing, and now you have 2 Hot Hot ground appliances.
Then you rewire both ends of the circuit to make the bare wire ground: punch it down to the ground bar in the panel, and change the receptacles to NEMA 6 (Hot Hot Ground)
You don't need to switch ground, so you need to switch both hots. I'll come back to the switching later.
This complies with the National Electrical Code. Modifying the appliance may violate different codes, but I'm not too worried about an all-metal appliance with metal innards that is properly grounded.
I don't know what I think of doing this external to the dryer by making a NEMA 6 to NEMA 14 converter box with a common step-up/down transformer inside it. it would have to be sized sufficient to handle the neutral load (which is not nearly as much as the hot load). It would need fuse protection on the neutral so you didn't smoke the stransformer. 240V loads would not go through the transformer.
Option 2: Super Stupid Mode
If you must... first use a mechanical relay, and second switch all three wires. The bare wire is being used for different purposes dryer vs charger, these incompatible uses cannot be shared. Also don't blame me when someone gets electrocuted stepping into your car - and that really could happen. This is a bad answer.
Option 3: Semi-stupid mode
Same but we'll take the worst of the life-safety risks out of it by installing a 2-pole GFCI breaker in the service panel, and this breaker ties to both hots and whatever that bare thing is.
The problem with this "solution" is, if there is any leakage to ground from the dryer's neutral or the vehicle charger's ground, this will trip the GFCI. So you would want do do everything you can to isolate the dryer and charger from ground.
So this has the risk of having a lot of nuisance trips.
Option 4: Gold standard, if...
You would need to check with your AHJ as to whether they will allow this old legacy wire to be a neutral. Remember the "currents must be equal" rule? The neutral must travel with the working conductors, since it is one.
However ground only carries fault current, so it is allowed to retrofit ground using a completely different route for the ground. Bare copper wires can even be buried.
So in this scenario, we positively define the legacy bare wire as a neutral. Then, we lay a ground wire via any practicable route, including outdoors, back to the same panel.
Now you replace that dangerous NEMA 10-30 HHN socket with a modern NEMA 14-30 HHNG socket. And rewire the dryer with a NEMA 14 socket, and remove the dryer's neutral-ground jumper which is part of the cord-change procedure.
Now, you have fully modern, safe wiring and can do whatever you need in the normal way. You could even put a subpanel here.
Now, if you're wondering, here's what you can't do: smack a ground rod into the earth and call it a good ground. Electricity wants to get back to source, not earth. Ground rods are great at returning natural electricity (ESD, lightning) to source (which is earth). But positively useless for returning human-made fault current to source (which is the power company's neutral wire. A ground-rod-only scheme will put lethal voltage on all your grounds the first time there is a ground fault.
Switching - avoiding it
You need to solve the above problems. But if you choose option 1 or 4, you may not have to switch. This comes up a lot, and we discovered if the breaker is 30A, you can simply have 2 receptacles on the circuit. Of course, you have to worry about tripping the breaker.
Another option if you use option 1 or 4, is take a look and see if they up-sized your cable. You can't tell at the socket, but look anywhere else you can access the cable sheath. It should have the size stated every 1 foot.
The circuit must use at least 10 AWG wire. But dryers are 23A, and the voltage drop would be a worrisome 8.05%. So it's a good idea to look at the actual current draw, and consider a bump to a heavier cable. These guys were cheap, and if they bumped, it may only be to #8. That will have a voltage drop of 5.30% which is acceptable. Some people consider 3% an absolute limit, and they would pick 6 AWG for 3.39% voltage drop.
The voltage drop limits are advisory, not mandatory. The mandatory limits are to keep the wire from overheating. 10AWG must have a 30A breaker, 8 AWG must have a 40A breaker, and 6 AWG is allowed a 60A breaker.
However, breakers larger than 30A don't allow multiple receptacles on them. In that case you would need a subpanel, which will absolutely require option 1 or 4.
You say your charger wants a 20A circuit. Ok, that means its continuous draw is 15-16A. Together with the dryer that adds up to 38-39A. However, due to the continuous-draw rules, you would need to derate that to 48-49A unless you use very specific breakers rated to carry at 100% rating. If you can line that up, #8 could power everything at once.
The subpanel is needed because 30A breakering for the dryer is mandatory. And really, so is 20A breakering for the charger. If you need switching, a subpanel is compatible with the idea, and makes it a bit easier actually.
Switching - relays
Throw away the electronics catalog, you can't use junk from that. Use either air conditioning contactors which are dirt cheap, or 3-phase contactors such as would be used on a compressor. They can be had with coils of 12V, 24V, 120V, 240V (handy) or 277V.
Anything with mains voltage should be fully enclosed in grounded (!!) metal boxes. If you want to do something under the much easier low-voltage rules, use 24VAC: there are transformers for thermostats which easily mount in standard junction boxes,vand all this stuff is dirt cheap.
Switching - Current Detection
Again, remember the "currents must be equal in a cable or conduit" rule. If wires in a circuit are tightly grouped, the AC magnetic fields cancel each other out. If they are not grouped, the fields do not.
Likewise if you took all the conductors of a circuit and wrapped them around a ferrite core in the same direction, the magnetic fields cancel each other out. If they are not wrapped in the same direction, they do not.
Have I painted a picture? :) Read the illustrated section of my answer here. Look at the specs on magnetic reed switches, it doesn't take much to actuate them, least not to the 16A or 23A you plan to flow. You may be able to just spread the wires and lay a reed switch alongside it.