OK, DON'T spend any money on the car! Take it back to where you bought it, and staying calm, tell the guy EXACTLY what you have told us on here. Tell him about the light on the test drive, tell him what explanation you were given for the light being on. Then tell him that you found the light disconnected and when you re-connected it, the EML was still on. DON'T tell him you know why it is on. If he starts lying to you (I bet top dollar he does), then tell him you know what he is saying is not quite right (try not to call him a liar), and you have had it checked and you know exactly why the light is on. (at this point he will probably get funny with you but you need to remain calm, polite and focused on what you want and need from this guy) Now you want to very calmly go through the motions about local press, trading standards etc. Point out that you would rather just have your car fixed and forget about the matter, but if you need to take steps you will.
I work in a main dealership and deal with salesmen on a regular basis about issues with sold cars, and they will do everything they can to avoid paying for repair bills. Last week I got asked if I thought a car with tyres that were very out of shape was safe and would I drive it if it was mine. :shock: I also quite often hear "is there any way round it"