This may not be a completely satisfying answer, but perhaps someone else can build upon it.
I don't think Mathematica has the capability to put compositional conditions into the styles of cells, to check "what's around them".
What you could do instead is to set InputOnly to be your default style, and include a costum CellEvaluationFunction that switches the style to input in cases where the return value of the compution is not Null.
Here is an example outlining the idea, however it could be improved.
styleSwich[] := (SelectionMove[EvaluationNotebook[], All,
EvaluationCell];
NotebookWrite[EvaluationNotebook[],
NotebookRead[EvaluationNotebook[]] /. "InputOnly" -> "Input",
After])
inputOnlyEvaluator[expression_,
StandardForm] := (Block[{res = ToExpression[expression]},
If[res === Null, Null, styleSwich[];
NotebookWrite[EvaluationNotebook[], res];]])
CellPrint[
ExpressionCell[5, "InputOnly",
CellEvaluationFunction -> inputOnlyEvaluator]]
To implement this in the style sheet, you just need to add CellEvaluationFunction -> inputOnlyEvaluator to the stylesheet definition, and then put styleSwitch and inputOnlyEvaluator into your init file to make sure they are there.
This is a one way trip however, and after you have evaluated a cell that produces an output cell, the cell will continue to be Input style. If you wanted both to be able to switch between each other, you'd need to make a new CellEvaluationFunction in a similar style for the Input cell.
notebooks
tag because I had trouble finding this question and for some reason I didn't think to search forstylesheet
and I couldn't remember InputOnly. $\endgroup$