The important part first: You can stay in your compartment - and to be safe, you should stay there during the stop in Salzburg.
This train consists of so-called "Kurswagen" - the individual cars go on different routes. In Salzburg cars get changed between trains. According to the schedule for early June: There is one train coming from Zurich via Innsbruck to Salzburg. This one gets split up into a part going to Budapest (EN 40467) and a part going to Vienna (NJ 467) as well as your train (EN 50467) to Praha.
Additionally, there is one train arriving from Munich (EN 463) that gets coupled to (EN 40467) and travels as one unit to Budapest.
For the sleeper cars, you will have a reservation and this one will be in the right car. So, remember which car is yours or you might have to explore the beautiful city of Vienna instead of the equally beautiful Praha the next morning. On the other hand, at 3 a.m. you should be sleeping.
The name change to S 1540 is probably due to the fact that the train is operated by the Czech railway from Linz on. This means that train crew changes and sometimes the engine is changed as well.