Escape quotes in query scripts