For example, if a pure Electric / Fire / Flying type used Double Shock / Burn Up / Roost, then would Struggle and Confusion damage get STAB, since the Pokémon are typeless?
A typeless Pokemon will never be able to gain STAB on a typeless move.
Pokémon that do not have a type do not get a bonus when using a move that does not have a type. For example, if a pure Fire-type Pokémon that used Burn Up (and so no longer has a type) uses Revelation Dance, Revelation Dance will not have a type, but does not receive the same-type attack bonus.
Same-type attack bonus (Bulbapedia)