I'm assuming you are creating the action as part of a vehicle addon based on your PM, so I will continue to ignore special scripting to prevent you being able to see the action if you are not in the pilot's seat. Probably easier to make the original script more generic than to make a separate script for flares:
// Run this script from an addAction with:
// this addAction ["Drop red smoke", "deployFromHelo.sqf", ["SmokeShellRed", "Smoke deployed!"], 0, false, true];
// this addAction ["Drop yellow flare", "deployFromHelo.sqf", ["F_40mm_Yellow", "Flare deployed!"], 0, false, true];
// Colours available are red, green or white.
private ["_helo", "_crewman", "_actionIndex", "_params", "_class", "_message"];
_helo = _this select 0;
_crewman = _this select 1;
_actionIndex = _this select 2;
_params = _this select 3;
_class = _params select 0;
_message = _params select 1;
// If you want to limit smoke drops, then remove the action with:
// _helo removeAction _actionIndex;
// Create coloured smoke shell under the helo.
_class createVehicle (_helo modelToWorld [0, 0, -3]);
// Give a general "system" message (rather than have the player talk to himself, which always annoys me ;) ).
private "_system";
_system = "logic" createVehicleLocal [0, 0, 0];
_system globalChat _message;
deleteVehicle _system;