Hi,
I like to repair rather than throw away. Can you remove the switch completely then test it using a DMM (digital multimeter) set on Ohms to determine if it is actually the switch at fault? The fault might be a poor connection or even an intermittent fault in the cable; my old but trusty Bosch drill started to behave strangely and it proved to be the cable where it entered the drill; I removed about 3" from the cable end and reconnected now it's fine again. Are the brushes OK?
Regarding replacing the switch with a different type I'd be very careful indeed; obtaining a switch with correct dimensions would be unlikely; it might work but it might also render the drill dangerous. May I suggest you ask the right people for your answer;
https://www.blackanddecker.co.uk/support/contact-us
Contacting B&D directly could save you lots of time and frustration. Good luck Ian.
Years ago I bought a cheap workshop vac and it had a speed control switch this switch was a slider; it stopped working so I investigated; the switch was a variable sliding resistor similar to this one;
Dust had entered destroying the track; I believe it was a 100 Ohms; at the time I was doing lots of vintage radio repairs and had thousands of resistors; I bypassed this linear resistor taking it out of circuit and installed an 80 Ohms 2W axial resistor ensuring it was safe. The vac is still in use; I gave it to a friend and he's added a small cyclone it's now used as a dust collector for his bandsaw.
A bit more information; I can highly recommend a novice to buy a DMM and learn how to use it; these can be bought very cheaply for a basic model through eBay; with these cheap models care is needed not to accidentally take voltage readings with it set to resistance (Ohms) or it will be destroyed.
Kind regards, Colin.