The FIRE command fires directly forward of one of the player ships when you don't use the autotarget.. For example:
FIRE wp_projvrtx
This fires the particle vortex cannon when you use the "gong". This isn't terribly useful though, as it won't always pick the first ship in your flotilla.
Setting variables etc can be done in a mission-specific quest. Each mission (in mission.ini) can launch up to eight quests by using multiple QEST commands.
Variables: Make a quest similar to haven.ini except instead of creating items, use the UVAR command in the star entries.
STAR 0
FLAG existing
PLNT hope
UVAR myvariable somevalue
END STAR
Items: The easiest way is probably to add to the above quest a check if you're at the Terran homeworld (ie. Hope), and if so, add the item. This should trigger as soon as the game starts. End the quest at that point to make sure it'll only happen once.
CONDITION 0
TYPE homeworld
STR0 terran
END CONDITION
PAGE 0
REQ0 0
ACTN endquest break
ITEM widget
END PAGE
The "haveitem" condition only works on cargo, sorry
