Red, blue, yellow and earth are the old colours for "three core and earth cable" used for two-way lighting circuits in the UK. Any wire which could be live (depending on switch state) would have red tape on it to indicate this (other than the red wire, which is always used as one of the "could be live" wires).
The three-core-and-earth is normally used between the two light switches on a two-way circuit. It is not normally used between a switch and the light fitting.
I can think of two possibilities off the top of my head:
The security light had both a switched live and a permanent live. So that when the switch is off the security light responds to movement (comes on for 30 seconds or so), and when the switch is on the light is permanently on. In this case the blue would be neutral, one of the red or yellow-with-red-tape would be permanent live and the other would be switched live. (NB There may be two switches in this setup. One "master switch" which turns on what I have referred to as permanent live, as well as supplying live to the other switch, which would control what I refer to as the switched live.)
Whoever wired it up had run out of two-core-and-earth but had some three-core-and-earth lying around, and used that. In that case one of the wires would probably be unconnected at both ends.
A key question here is: What were the wires connected to before you took the old security light off? But I guess it's a bit late for that now.
A practical thing you could do is to connect all the wires separately into connector blocks. Then turn the power back on, try flicking the switches, and use a voltage tester to check which wires might become live. This would be able to detect situation 1 above. It wouldn't confirm situation 2, though it could confirm that it's a possibility.
(All this is clearly too late 15 months after you asked, but this might help someone in future with a similar situation)