On 18 June 2009, for the start of the 2009–10 season, Lilley signed again for Queen of the South. Lilley was given the club captaincy at the start of the season. Lilley received the player of the year award for the 2009–10 season from the Doonhamers Travel Club. On 19 May 2011, Lilley was released by Queen of the South. Lilley spent two seasons in his second spell in Dumfries, playing in 61 league matches and scoring 2 league goals. In all competitive matches, over two spells with Queen of the South, Lilley started 157 times and appeared as a substitute 4 times, scoring 3 goals.