The company will use a get-out along the lines of 'oh this is a standard ad we put in from time to time, it's not your actual job...' Don't worry about it. If a firm sacks you for having the temerity to look for a job, they would be liable to pay damages after an industrial tribunal and no firm wants that.
However what you must learn from this, is not to mention leaving a post until you are ready to go - the employer is mentally writing you out of plans once you say you are planning to go. And join a union.
If you have handed in written notice they can work on a definite end date and employ a replacement afterwards.
If you want to find work you will, and from the sound of things it will probabaly be better for you to leave and take stock if the job has been winding you up.
All of the above becomes very different if you are employed at a high level in a firm - some firms will pack up an exec's desk if there is even a rumour that they have been looking at the job ad's.