It matters but not for the reason you think. The sensor is not detecting the speed directly, it simply counts how much time it takes between times that the magnet comes around. This does not change depending on where on the spoke you place the magnet and sensor. However, if you read our responses carefully, you'll see that one possible problem is that if you put the magnet and sensor out near the rim, the magnet is going past the sensor much faster, and the sensor may miss seeing the magnet sometimes, resulting in lower readings.
All the computer is doing is counting how many times per minute the magnet goes past. That is, and must be, the same no matter where on the spoke you place it.
If you think about it, if it DID matter, like if somehow the sensors was actually measuring how fast the magnet went past it, it would read FASTER the farther from the rim you got. And it would make a HECK of a lot more difference than a few miles per hour - on a 700c tire, you've got about 2155 millimeters around it. If you put the magnet near the axle so you had perhaps an effect 10" rim, that would be 127mm radius * pi^2 = 1252mm circumference. So if you were going 20 MPH, that's 8839mm/second so your tire would be turning 4.1 times per second, but a sensor placed near the axle would be seeing that 4.1 turns per second and thinking that meant you were travelling 1252*4.1 millimeters per second, which works out to 11.5 miles per hour.
I have tried it for myself; I've put my sensor and magnet in all kinds of different locations, and the ONLY difference that it makes is that with the magnet near the rim, at higher speeds, sometimes it misses counts and starts to read lower.
When that happens, the speed usually jumps WAY down because it thinks your tire just started turning half as fast or even less. This won't happen at low speeds, only high speeds.
There is also another problem that's less often seen where the magnet is mounted SIDEWAYS, and the sensor gets a double hit every time the magnet goes by, once for the north pole and once for the south pole of the magnet.
As far as counting on your motor to always be going exactly 20 MPH, I don't believe it. I assume the controller is set to deliver a fixed maximum amount of current to the motor. What speed that translates into is going to vary substantially given the tire pressure, wind speed and ambient air temperature (air at 32*F is about 10% denser than air at 80*F, so you'll go slower through it)
A friend of mine with a very nice ebike has a digital readout on his that is constantly showing him the number of watts being drawn by the motor, and he says that at any given speed, even a 10 PSI drop in tire pressure can result in 20% more draw on the batteries. If you have a constant current supply, that means 20% less speed instead.
Bottom line; it should make no difference, and if it does, it's not because of the sensor reading faster/slower, it's because the sensor is not picking up every rotation because the magnet moves too fast at high speeds. And you can't rely on the motor to be carrying you at exactly 20 MPH.
__________________
Work: the 8 hours that separates bike rides.