I saw the following sentence in the tale "three little pigs" (you have to start somewhere, right :);
Alors que le petit cochon venait juste de finir de construire sa maison et qu'il s'était allongé pour faire une sieste dans son lit en paille […]
As I understand the sentence simply says that once he had finished building his house and has taken a nap – something happened (the big bad wolf arrived, in this case), and so it makes sense that it uses the imperfect tense. If so, why does it use "allongé" and not the imperfect form "allongeait"?
These tenses still confuse me.