If I was you, I would check with a mains detector tool, possibly one of those screwdrivers with a neon in it. Only one wire should be live and it should be the red one, but it might be one of the others. Anyway, having found the live wire, I'd turn off the mains at the spur controlling the system, and check that nothing is now live. If all ok, then I'd assume this:
the red wire is the live in,
the yellow wire goes to the boiler/pump as a start signal when the thermostat contacts close,
the blue wire comes from the house neutral.
The earth wire should connect to the metal backplate
Then I'd use a multimeter to find which two terminals are connecting when the thermostat is turned to 'hot'. You can probably see which these two are anyway. One of these is to connect to red, the other to yellow, but which?? the answer is found with the multimeter. One of the two terminals previously found will also connect to the neutral teminal via a resistor with a value of about 100k ohms to 500 kohms regardless of the temperature setting and this should be put to the yellow. The other only connects to the neutral via the resistor when the contacts close and this should be put to the red. The blue goes to the neutral terminal.
Or - ringup Potterton!!
Provided your isolating fused spur is actually connected properly (i.e. circuits all dead when the spur is off) and you have the right fuse in it (probably 3A). I don't think you can go too far wrong, but you know it's all a bit dodgy, because it's not connected. So you may well need some help from an electrician.
A further thought - You don't actually say if the heating is running or not. If it is, someone has bypassed the thermostat and you're going to have to remove that link first, might be hard to find - gets worse, doesn't it!