I am unsure IML is best suited for these simple calculations. Not really "general program" I reckon.
You assume the diagonal line crosses the plot's vertical boudaries in your calculations, I kept the same assumption for simplicity's sake.

Something like the following code does the same and is a lot simpler to write and understand imho (and doesn't require a SAS/IML licence to run):

%let intercept = 0;
%let slope = 1;

proc sql noprint;
select min(MPG_City) as xDataMin
, min(MPG_Highway) as yDataMin
, max(MPG_City) as xDataMax
, max(MPG_Highway) as yDataMax
, calculated xDataMin
, &intercept + &slope ** calculated xDataMin
, calculated xDataMax
, &intercept + &slope ** calculated xDataMax
into :xDataMin, :yDataMin, :xDataMax, :yDataMax
, :xLineMin, :yLineMin, :xLineMax, :yLineMax
from SASHELP.CARS;

create view CARS as
select *
from SASHELP.CARS
outer union corresponding
select &xLineMax as LX
, &yLineMax as LY
from SASHELP.CARS(obs=1);
quit;

The web site botches up asterisks (I had to double them) and formatting (please accept < pre > tags ).