How to find a variable that works?

On that first line of your code, there doesn’t seem to be any reason to keep jumping in and out of PHP like that. Can’t you just use:

<tr class="first last" style="display:none;<?php while($resultn = $result->fetch(PDO::FETCH_ASSOC)): extract($resultn); if ($rma_id) echo 'display:block'; endwhile; ?>">

Doesn’t running through the while() loop at that position ruin it for the lower section where you actually want those results to display in the table body?

Is there a way you can get the result count for the query before you start the table, and just wrap the entire table in an if() clause? So assuming the query has already run:

<?php $result = $this->getRmaList(); ?>
<div class="page-title title-buttons">
    <h1><?php echo $this->__('Request For Return Merchandise Authorization (RMA)') ?></h1>
</div>
<a href="<?php echo Mage::helper('core/url')->getHomeUrl(); ?>rma/index/request">
<h4 align="right"><?php echo $this->__('Add New RMA') ?></h4></a>

<?php if ($result->rowCount > 0) { ?>

<table class="data-table" id="my-orders-table">
<thead>
<tr class="first last">
<th><?php echo $this->__('RMA') ?></th>

and then close the if after the </table> tag? Or if it’s just the <thead> block you want to lose, then stick the if() around that part instead?