Does it work?
The first section is doing well registering d input twice into q output but without obvious purpose.
The process underneath is a mystery. It can't be there.
What do you actually want the fpga to do with the door?
If you want simple logic control to open/close door and assuming you have one input called "ctrl" as a short pulse indicating close if open, open if close then:
PROCESS (clk)
BEGIN
IF rising_edge(clk) THEN
ctrl_d <= ctrl;
if ctrl /= ctrl_d then -- detect change by user
toggle <= not toggle;
end if;
q <= toggle; -- should settle as either 0 or 1
END IF;
END PROCESS;
to prevent the door being getting stuck in wrong state or bounce back dangerously then you need to define a reset state and debounce the ctrl input.