https://wiki.srb2.org/wiki/Cut-Away_View
If you want to run it when you press a button in the map, just set up a normal linedef executor with that effect, tagged to the button. If you want it to run when you press a button on the keyboard, use Lua to trigger a linedef executor set up in a similar fashion.
addHook("MobjThinker", function(mo)
if not mo.player then continue end
local buttons = mo.player.cmd.buttons
if buttons & BT_CUSTOM1 then -- or any other button you'd like
P_LinedefExecute(4000, mo) -- or any other tag you'd like
end
end, MT_PLAYER)
(You could also manually search for the object and set player.awayviewmobj, player.awayviewtics and player.awayviewaiming manually, if you're prefer.)