if you're using a plugin layer, checking for things like
if($this->template == 'ask')
, for example, works. This is how the polls plugin does it:
else if($this->template == 'ask' && !qa_user_permit_error('permit_post_q') && !qa_opt('site_maintenance') && qa_permit_check('permit_post_poll')) {
$this->content['form']['tags'] .= ' onSubmit="pollSubmit(event)"';
$this->content['form']['fields'][] = array(
'label' => qa_opt('poll_checkbox_text'),
'tags' => 'NAME="is_poll" ID="is_poll" onclick="jQuery(\'#qa-poll-ask-div\').toggle()"',
'type' => 'checkbox',
);
$this->content['form']['fields'][] = array(
'note' => '<div id="qa-poll-ask-div" style="display:none"><p class="qa-form-tall-label"><input type="checkbox" name="poll_multiple">'.qa_opt('poll_multiple_text').'</p><p class="qa-form-tall-label">'.qa_opt('poll_answers_text').'</p><input type="input" class="qa-poll-answer-text" class="qa-poll-answer-text" name="poll_answer_1" id="poll_answer_1"> <input type="button" class="qa-poll-answer-add" value="+" onclick="addPollAnswer(poll_answer_index)"></div>',
'type' => 'static',
);
}
I haven't used the built in meta functions yet, but they look simple enough. qa_db_postmeta_get is the other one you need.