- Have the SCV owned by a computer player you don't have vision with, have it where no human lpayer will see it.
- Disable the scv
- Wait 0 milliseconds
- Enable the scv
- Wait 0 milliseconds
- Order the SCV to move somewhere (it doesn't have to be able to go anywhere, it just has to try)
- Wait ~500 milliseconds
- Move the SCV somewhere
- Give it to a human player
It'll cloak about 1/2 to 1 second after that. Luckily, the SCV is a unit that won't crash StarCraft if a humn player sees it when it cloaks.
As for units that can be walked through, you do the same thing, but with a disabled unit sprite. (
Link).