Things happen one at a time.
You are using 4 MU out of 4 available.
You install SMC - you are now 2 MU over your limit. You must trash 2 MU worth of programs.
You use the trash effect of SMC - you are now 2 MU below your limit.
The trash effect resolves and installs a program. Assuming it’s 1 MU, you still have 1 MU remaining.
As with much of the game, don’t rush through changing game states, or you will risk confusion.