I do not see much point in creating a trigger that executes a query, unless the result of that query is saved in a temporary table or in a variable that you can use in another part of your project .
If you want to do something like that, I can think of this:
-- Opcion 1: Almacenar el resultado en una variable
delimiter $$
create trigger tr_pedidos_ai
after insert on pedidos
for each row
begin
SELECT timestampdiff(MINUTE, fechaDeSolicitud, now()) <= 120
INTO @ts_diff
FROM pedidos
WHERE idPedido=new.id_pedido;
end $$
delimiter ;
In some other part of your application, you can execute this query:
select @ts_diff;
that will return the value you are interested in.
Now, you can also create a function that executes the query and returns what you want, and call that function when you need it:
delimiter $$
create function ts_diff(id int) returns int
begin
declare diff int;
select timestampdiff(MINUTE, fechaDeSolicitud, now()) <= 120
into diff
from pedidos
where idPedido = id;
return coalesce(diff, 0);
end $$
delimiter;
And you can execute this function whenever you need it in some other part of your application:
set @idPedido = 1; -- valor de prueba
select ts_diff(@idPedido);